OK. Here it is:
I want to record sound for 1 second (I use timer for this). The problem I have is that mciSendString returns 295 value (captured in "i" variable) at the line with the "save" command. Anyone knows why is this happening?
Thanks!!!
Hope I've been helpful,
Bogdan Muresan.
I want to record sound for 1 second (I use timer for this). The problem I have is that mciSendString returns 295 value (captured in "i" variable) at the line with the "save" command. Anyone knows why is this happening?
Thanks!!!
Code:
Private Sub cmdRecord_Click()
Dim i As Long, RS As String, cb As Long
If cmdRecord.Caption = "Record" Then
i = mciSendString("open new type waveaudio alias capture", RS, 128, cb)
' i = mciSendString("set capture bitspersample 8", 0&, 0, 0)
' i = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
' mono (1) / stereo (2):
' i = mciSendString("set capture channels 1", 0&, 0, 0)
i = mciSendString("record capture", RS, 128, cb)
t# = Timer + 1: Do Until Timer > t#: DoEvents: Loop
cmdRecord.Caption = "Stop"
Else
i = mciSendString("stop capture", RS, 128, cb)
DoEvents
[highlight #FF99FF]
i = mciSendString("save capture C:\Incercari\vb\Sound - wav\NewWave2.wav", RS, 128, cb)
[/highlight]
'Debug.Print RS
Print RS
i = mciSendString("close capture", RS, 128, cb)
cmdRecord.Caption = "Record"
End If
End Sub
Hope I've been helpful,
Bogdan Muresan.