eng70640
May 6th, 2001, 02:13 PM
I have been using mcisendstring to record voice over microphone & noticed that when i am recording & i save into a .wav file but when my textbox value changes in the textbox change event i have a code which stops & saves the recording into 1bitmap.wav & start recording another .wav file & the cycle repeats when text box value changes & 2bitmap.wav file is saved. Hopwever , i noticed that if 2bitmap.wav contains the whole of 1bitmap.wav just that it continues recording from the end of 1bitmap.wav. I want to record 2bitmap.wav without the inclusion of the conents of the 1bitmap.wav. Can anyone help me ?
Below is my code.
'in module
Public 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 Command1_Click()
dim i as long
i =1
bitmap = CStr(i) + "bitmap"
'samplespersec can be:
'11025
f = mciSendString("open new type waveaudio alias capture", 0&, 0, 0)
f = mciSendString("set capture bitspersample 8", 0&, 0, 0)
f = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
f = mciSendString("set capture channels 1", 0&, 0, 0)
f = mciSendString("record capture", 0&, 0, 0)
End Sub
Private Sub Text1_Change()
If i <> 0 Then
q = "save capture " & bitmap + ".wav"
f = mciSendString("stop capture", 0&, 0, 0)
f = mciSendString(q, 0&, 0, 0)
End If
i = i + 1
'samplespersec can be:
'11025
f = mciSendString("open new type waveaudio alias capture", 0&, 0, 0)
f = mciSendString("set capture bitspersample 8", 0&, 0, 0)
f = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
f = mciSendString("set capture channels 1", 0&, 0, 0)
f = mciSendString("record capture", 0&, 0, 0)
End Sub
Below is my code.
'in module
Public 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 Command1_Click()
dim i as long
i =1
bitmap = CStr(i) + "bitmap"
'samplespersec can be:
'11025
f = mciSendString("open new type waveaudio alias capture", 0&, 0, 0)
f = mciSendString("set capture bitspersample 8", 0&, 0, 0)
f = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
f = mciSendString("set capture channels 1", 0&, 0, 0)
f = mciSendString("record capture", 0&, 0, 0)
End Sub
Private Sub Text1_Change()
If i <> 0 Then
q = "save capture " & bitmap + ".wav"
f = mciSendString("stop capture", 0&, 0, 0)
f = mciSendString(q, 0&, 0, 0)
End If
i = i + 1
'samplespersec can be:
'11025
f = mciSendString("open new type waveaudio alias capture", 0&, 0, 0)
f = mciSendString("set capture bitspersample 8", 0&, 0, 0)
f = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
f = mciSendString("set capture channels 1", 0&, 0, 0)
f = mciSendString("record capture", 0&, 0, 0)
End Sub