Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: playmedia sound playback record
Use Short filenames only, since the Playmedia stuff needs short names. For example:
PlayMedia("save mysound c:\temp\me.wav wait")
;Message("Parrot","Press OK to record") ;Assuming you have a microphone with your sound system, ;and you can record using sound recorder, then this script ;will record and playback stuff. fname="c:\temp\me.wav" while 1 BoxOpen("Parrot","Hold shift key down to record (9 seconds max)%@CRLF%Hold CTRL to exit") while !IsKeyDown(@shift) if IsKeyDown(@CTRL) then goto byebye ;TimeDelay(0.25) endwhile PlayMedia("open new type waveaudio alias mysound buffer 9") PlayMedia("record mysound") BoxText("Recording...") while IsKeyDown(@SHIFT) TimeDelay(0.25) endwhile BoxText("Playback") PlayMedia("stop mysound") if FileExist(fname) then FileDelete(fname) PlayMedia("save mysound %fname% wait") PlayMedia("close mysound") PlayWaveform(fname,0) endwhile :byebye Display(1,"All","Doned")
The WinBatch PlayMedia functions calls the mciSendString API that send a command stirng into the Windows multimedia system. Almost any program can use it. The mciSendString call is fairly simple, except that you need to know the magic command stirngs to send to control the devices.
The theory was that the purveyors of various multimedia hardware would document what command strings their devices responded to. This has not, as far as I can tell, happened. Instead Microsoft has taken up the slack and has been documenting the various strings in their Visual C++ documentation.
So, to really use PlayMedia you have to track down the documentation for the strings you can use with the Windows mciSendString function. Do you have MSDN? You might start with MCI Command strings if you do, check out the quality command, and also the setaudio one.
So basically, you can use any of those mci commands ("open", "play", "record", "setaudio", "quality" ) by using the "PlayMedia" WinBatch instruction ( which in turn invokes the command by calling "mciSendString" ). With some minor questions about "wait" and "notify". But try it anyway.
I believe wait is removed from the command line and handled differently. and Notify is simply removed. Everything else ought to work just fine.
Article ID: W13754
Filename: Parrot Script to Playback Recorded Wave File.txt
File Created: 2000:08:28:09:32:10
Last Updated: 2000:08:28:09:32:10