Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MMControl  ( for  recording from microphone)

Posted on 2000-02-17
6
Medium Priority
?
844 Views
Last Modified: 2013-12-26
Hello,
I want to record at run time.
I use the MMControl, but I have some difficulties.
I want to be able to record my voice and then save it in wave file. I want that every time I record - it will be saved to a different file. ( I tried, but all the records were saved continuously to the same file ).
( I have the same problem for playing the files ).

Thanks...
0
Comment
Question by:chen_meir
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2533874
You have to stop the recording, save the wav file, close the MCI control, and then set the new path to the next wav file and open the MCI device again.

Also dont forget to set the record mode:

    MMControl1.RecordMode = mciRecordOverwrite


Cheers!
0
 

Author Comment

by:chen_meir
ID: 2535813
Adjusted points to 90
0
 

Author Comment

by:chen_meir
ID: 2535814
dear mcrider ...
i did what you said.
i created a button for record ("rec"), a button to stop the record
("sto") and a button to play ("play").
i did some recording but it didnt work.
if it worked ,it was only some times and after that it did whatever it wanted. ( i noticed that some of the files after i closed the project i could not manage delete them (i got the message "access denaied").

here is my code:

'start the play
Private Sub play_Click()

MMControl1.Notify = True
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "WaveAudio"

str = "C:\My Documents\" & i & ".wav"
MMControl1.FileName = str
MMControl1.Command = "open"
MMControl1.Command = "play"
MMControl1.Command = "prev"
End Sub



'start the record
Private Sub rec_Click()

MMControl1.Command = "prev"
MMControl1.RecordMode = mciRecordOverwrite
str = "C:\My Documents\" & i & ".wav"
MMControl1.FileName = str
voiceRec(number).voicePath = str
MMControl1.Command = "open"
MMControl1.Command = "record"

End Sub



'stop the record
Private Sub sto_Click()
MMControl1.Command = "stop"
MMControl1.Command = "save"
MMControl1.Command = "close"
End Sub

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Accepted Solution

by:
mcrider earned 360 total points
ID: 2535931
Try this:

In a new project, add a MMControl, a TextBox and 3 Command Buttons... Then paste the following code into the DECLARATIONS Section of FORM1:

Private Sub Command1_Click()
    MMControl1.Notify = False
    MMControl1.Wait = False
    MMControl1.Shareable = False
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.filename = Text1.Text
    MMControl1.To = 10000
    MMControl1.Command = "Open"
    MMControl1.RecordMode = mciRecordOverwrite
    MMControl1.Command = "Record"
End Sub
Private Sub Command2_Click()
    MMControl1.Command = "Save"
    MMControl1.Command = "Close"
End Sub
Private Sub Command3_Click()
    MMControl1.Notify = False
    MMControl1.Wait = False
    MMControl1.Shareable = False
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.filename = Text1.Text
    MMControl1.Command = "Open"
    MMControl1.Command = "Play"
    Do
        If MMControl1.Mode <> mciModePlay Then Exit Do
        DoEvents
    Loop
    MMControl1.Command = "Stop"
    MMControl1.Command = "Close"
End Sub
Private Sub Form_Load()
    Text1.Text = ""
    Command1.Caption = "Record"
    Command2.Caption = "Stop Rec"
    Command3.Caption = "Play"
End Sub




Run the program and type the name of a WAV file (including the .WAV extension) and press the "Record" command button... Talk into your microphone and then hit the "Stop Rec" command button. Then Hit the "Play" command button... You should hear your voice.

Do it again with another file....


Cheers!
0
 

Author Comment

by:chen_meir
ID: 2537427
Dear mcrider!!!!

thank you very very much!!!!
I appreciaite it very much!!

Chen.
 
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2537726
You're welcome! thanks for the points... Glad I could help!


Cheers!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question