PDA

Click to See Complete Forum and Search --> : Severe winAPI32 MCI Headaches....


SteveS
Nov 4th, 1999, 08:29 AM
OK, recording "Mic" to a .Wav File.
NOTE: This will record everything heard on the speakers. So make sure the CD etc... is stopped.

Public Sub RecordWave(Filename As String)
'Filename: file to save wave as

On Local Error Resume Next
Dim varVoid As Long
Dim RetStr As String
Dim varT#

RetStr = Space$(64)

varVoid = mciSendString("open new type waveaudio alias capture", RetStr, 64, 0)

varVoid = mciSendString("record capture", RetStr, 64, 0)

'1 Millisecond capture
varT# = Timer + 1
Do Until Timer > varT#
DoEvents
Loop

varVoid = mciSendString("save capture " & filename, RetStr, 64, 0)

End Sub

Hope this helps,

Steve.

space_cadet
Nov 4th, 1999, 11:01 AM
Ok,

Im trying to encode audio from the line-in/mic input on my sound card and save it as a wav. The process then moves to WAVtoASF.exe to encode the wav file as an ASF file for the web, but after struggling with the rather archaic MCI and multimedia control, I can get what I think is recorded data but cant save or play the wav. If anyone can help me I would really appreciate it.

Cheers for your time,

Ben Davies
ben@lwe.com