PDA

Click to See Complete Forum and Search --> : select the LINEIN using API's


Nov 27th, 2000, 02:23 PM
How can I select the LINE IN (or MIC) input to the soundcard for recording using API's (or other VB coding)?
Are the relevant API's documented anywhere on the web?

Nov 27th, 2000, 02:25 PM
You want to record WAV files? Use mciSendString API.

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

Nov 27th, 2000, 02:45 PM
I am experimenting with FFT code from DEETH which uses
waveiopen, etc api's to read the sound buffer and analyzise it. I need only to direct the sound input from the LINEIN or MIC inputs.

PS. your VBFE link does work!

pradeepkrao
Mar 5th, 2002, 03:21 AM
I have a small doubt..

How can i get the audio level ...
i tried using


Text1.Text = mciSendString("status MP3Play level", yn1, Len(yn1), 0)


but doesnt work.. Please help me out...

Thanks in advance,
Pradeep