Restored from previous forum. Originally posted by Chevron.
How would I go about recording an input from a microphone? Any examples or pointers greatly appreiated.
Thanks
Recording Microphone Input
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> How would I go about recording an input from a microphone?
viewtopic.php?t=1288
PB - Registered PureBasic Coder
> How would I go about recording an input from a microphone?
viewtopic.php?t=1288
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> doesn't seem to let you set bit rate to 8000hz though
From http://tinyurl.com/281v I worked out that you need to specify the
"bytespersec" setting to 8000 in addition to the "samplespersec" setting.
So here's a working example (tested successfully):
PB - Registered PureBasic Coder
> doesn't seem to let you set bit rate to 8000hz though
From http://tinyurl.com/281v I worked out that you need to specify the
"bytespersec" setting to 8000 in addition to the "samplespersec" setting.
So here's a working example (tested successfully):
Code: Select all
Procedure RecordWave(Filename.s,RecordTime)
RS.s = Space(128)
DeleteFile(filename)
i = mciSendString_("open new type waveaudio alias capture", RS, 128, 0)
i = mciSendString_("set capture samplespersec 8000 bytespersec 8000", 0, 0, 0)
i = mciSendString_("record capture", RS, 128, 0)
Delay(RecordTime)
i = mciSendString_("save capture " + filename, RS, 128, 0)
EndProcedure
;
MessageRequester("Info","Capture Audio to c:\test.wav",0)
RecordWave("C:\test.wav",2000)
MessageRequester("Info","Done!",0)
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Paul.
Check out the Code Snippet from February on the Resources Site... it will show you how to properly record WAV files using MCI commands at any sample/bit rate.
(search for WAV in Code Snippet section)
----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb
Check out the Code Snippet from February on the Resources Site... it will show you how to properly record WAV files using MCI commands at any sample/bit rate.
(search for WAV in Code Snippet section)
----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb