|
-
Aug 22nd, 2000, 06:51 AM
#1
Thread Starter
New Member
Hi
I use the following code to record MIC input to WAV file :
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long
Private Sub cmdRecord_Click()
Dim i As Long
i = mciSendString("open new Type waveaudio Alias capture", 0&, 0, 0)
i = mciSendString("set capture bitspersample 8", 0&, 0, 0)
i = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
i = mciSendString("set capture channels 1", 0&, 0, 0)
i = mciSendString("record capture", 0&, 0, 0)
End Sub
Private Sub cmdStopRecord_Click()
Dim i As Long
i = mciSendString("stop capture", 0&, 0, 0)
i = mciSendString("save capture c:\NewWave.wav", 0&, 0, 0)
i = mciSendString("close capture", 0&, 0, 0)
End Sub
-------------------------------------------------------------
My quastion is :
How can I change the name of the file according to input from the user
I tried to create FileName veriable (string) and to change to :
FileName = "abc.wav"
("save capture FileName", 0&, 0, 0)
But it only crears new WAV file name FileName.
Any Idea ?
Thanks
Eran
-
Aug 22nd, 2000, 07:06 AM
#2
So Unbanned
Originally posted by eran114
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long
Private Sub cmdRecord_Click()
Dim i As Long
i = mciSendString("open new Type waveaudio Alias capture", 0&, 0, 0)
i = mciSendString("set capture bitspersample 8", 0&, 0, 0)
i = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
i = mciSendString("set capture channels 1", 0&, 0, 0)
i = mciSendString("record capture", 0&, 0, 0)
End Sub
Private Sub cmdStopRecord_Click()
Dim i As Long
i = mciSendString("stop capture", 0&, 0, 0)
i = mciSendString("save capture c:\NewWave.wav", 0&, 0, 0)
i = mciSendString("close capture", 0&, 0, 0)
End Sub
Do this:
Dim MyWavFile as String
MyWavFile = "c:\sound.wav"
then change:
i = mciSendString("save capture c:\NewWave.wav", 0&, 0, 0)
to:
i = mciSendString("save capture" & MyWavFile, 0&, 0, 0)
Good luck,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|