WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: billfrog on June 25, 2013, 05:21:11 AM

Title: Recording Audio?
Post by: billfrog on June 25, 2013, 05:21:11 AM
OK, I've been through the technical database, and worked through the Parrot script as listed below:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/Sample~code+Parrot~Script~to~Playback~Recorded~Wave~File.txt

But I am uncertain as to how to adjust various parameters of the PlayMedia command. In particular, I want to increase the quality of the audio. I've looked through documentation on the MCISendString command, but am still uncertain as to how to change the quality in the Parrot.wbt script. By default it seems to record at 8 bits, mono, 11kHz. What would I have to alter in order to record at, say 16 bits stereo 44100kHz (CD Quality)?



Title: Re: Recording Audio?
Post by: IJRobson on June 25, 2013, 06:17:40 AM
You could try the setaudio command string that appears to change quality settings:

http://msdn.microsoft.com/en-gb/library/windows/desktop/dd743572%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-gb/library/windows/desktop/dd743572%28v=vs.85%29.aspx)

I have not used the PlayMedia interface so I am not sure how you use the command?
Title: Re: Recording Audio?
Post by: Deana on June 25, 2013, 08:34:54 AM
The set command establishes control settings for the device. Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/dd798661(v=vs.85).aspx

Maybe give this a try:
Code (winbatch) Select

; samplespersec options:   
; 11025 low quality 4 to 1 compression ratio   
; 22050  medium quality compression 8 to 1 (12%)   
; 44100   (CD music quality)compression 16 to 1 (6%)file size bigger   
; bitspersample: 16 or 8   
; Channels: (mono) or 2 (stereo)   
PlayMedia( "seek capture to start" )           ; Always start at the beginning   
PlayMedia( "set capture samplespersec 44100" ) ; CD Quality   
PlayMedia( "set capture bitspersample 16" )    ; 16 bits for better sound   
PlayMedia( "set capture channels 2" )          ; 2 channels for stereo   
PlayMedia( "record capture" )