Вопрос
Как записать звук с микрофона?
Ответ
Recording WAV file
'----
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub cmdRecordFromCD_Click() ' RECORD WAV
Dim i As Long, RS As String, cb As Long, t#
On Error Resume Next
RS = Space$(128)
Kill "c:\cdtest.wav"
cmdPlayCD.Value = True
i = mciSendString("open new type waveaudio alias mywav", RS, 128, cb)
i = mciSendString("record mywav", RS, 128, cb)
t# = Timer + 1: Do Until Timer > t#: DoEvents: Loop
i = mciSendString("stop mywav", RS, 128, cb)
i = mciSendString("save mywav c:\cdtest.wav", RS, 128, cb)
i = mciSendString("close mywav", RS, 128, cb)
cmdStopCD_Click
On Error GoTo 0
End Sub
@LEXis
Copyright 2000-2004 Сообщество Чайников
Контактная информация