How can I write directly to audio device output buffer, or the speaker of it, and how can read the microphone input directly from it's buffer, is there any API function to do that?
Printable View
How can I write directly to audio device output buffer, or the speaker of it, and how can read the microphone input directly from it's buffer, is there any API function to do that?
To read from a microphone, you could use the mciSendString API.
VB Code:
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() 'Open a WaveAudio called Record mciSendString "open new type waveaudio Alias record", 0&, 0, 0 'Start Recording mciSendString "record record", 0&, 0, 0 End Sub Private Sub cmdSave_Click() 'Stops recording mciSendString "stop record", 0&, 0, 0 'Saves the sound mciSendString "save record C:\Windows\Desktop\MyWav.wav", 0&, 0, 0 'Close "Record" mciSendString "close record", 0&, 0, 0 End Sub