Page 1 of 1

Record easy a wavefile. Windows Code only

Posted: Sat May 11, 2002 9:51 am
by BackupUser
Code updated for 5.20+

Restored from previous forum. Originally posted by Rings.

Record easy a wavefile.Windows Code only.

Code: Select all

Procedure RecordWave(Filename.s, RecordTime)
  RS.s = Space(128)
  DeleteFile(filename)
  
  i = mciSendString_("open new type waveaudio alias capture", RS, 128, cb)
  i = mciSendString_("record capture", RS, 128, cb) 
  
  Delay(RecordTime)
  
  i = mciSendString_("save capture " + filename, RS, 128, cb)
EndProcedure

MessageRequester("Info","Capture Audio to c:\test.wav",0)
RecordWave("C:\test.wav", 2000)
MessageRequester("Info", "Ready...", 0)
 
Its a long way to the top if you wanna .....CodeGuru
:wink:

Posted: Sat Oct 26, 2002 10:20 am
by BackupUser
Restored from previous forum. Originally posted by PB.

Note to anyone using the above tip: You can leave out the vSpace()
procedure totally and replace all vSpace() references with PureBasic's
own Space() command instead.

Also, if you want to change the sample rate (etc), see this web page:

http://www.geocities.com/smigman.geo/mci/wav.html


PB - Registered PureBasic Coder

Posted: Sat Oct 26, 2002 4:41 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

There is actually a code snippet on the Resources Site (back from February) that shows how to do this along with sample rate settings, etc. :wink:


----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb