-
Not quite Graphics & Gaming, but kinda in the same field :)
I'm looking for an mci string or API call which will allow me to set the recording source for the computer's sound card. Ideally I'd like to toggle between the line-in devce and cd-audio device.
Any help would be appreciated.
-
Use the mciSendString API to record sounds. Make a Form with 2 CommandButtons (cmdRecord and cmdSave) and put the following code into your Form.
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
-
Cheers... but....
Does this actually set the recording *source*?
I understand that the code you've posted allows me to perform the recording - that I can do fine. But I need to set the source - as you would throught the sound card's mixer. I need to be able to switch between recording the CD Audio input and the Line input.
Any ideas?