Forum Home
Press F1
 
Thread ID: 26798 2002-11-05 12:06:00 PLAYING SOUND IN A BATCH FILE? Ian W (2457) Press F1
Post ID Timestamp Content User
96282 2002-11-05 12:06:00 What is the command line format for playing a .WAV sound file directly in a batch file under WIN98se, without manual intervention?
CD C:\WINDOWS\MEDIA
SNDREC32 TADA.WAV
will successfully open sound recorder with the file tada.wav, but still needs a manual selection of the play button. I don't particularly want to see the recorder control panel either. Suggestions?
Ian W (2457)
96283 2002-11-05 19:33:00 In the old Soundblaster driver disks there used to be included a program called Play.exe, which you could use to play .wav files from the command prompt (something like play tada.wav would just play the Tada). If you can get a hold of the Play program, this will do what you want.

Mike.
Mike (15)
96284 2002-11-05 19:40:00 Didn't that require dos drivers to be loaded for the soundcard though! roofus (483)
96285 2002-11-05 19:41:00 try some switchs in your batch like sndrec.exe /p or sndrec.exe /play roofus (483)
96286 2002-11-05 21:44:00 sndrec32 /play /close my.wav

Or to run it hidden:

sndrec32 /embedding /play /close chimes.wav

If you use the embedding flag make sure you use the /close flag or it will keep running in the background.


I just opened sndrec32.exe in a text editor and searched for what looked like arguments.
bmason (508)
96287 2002-11-05 21:47:00 >>> Didn't that require dos drivers to be loaded for the soundcard though!

It might, but I don't think it should, as the drivers in Windows should be enough (maybe :D)

Mike.
Mike (15)
96288 2002-11-05 23:38:00 > > > > Didn't that require dos drivers to be loaded for
> the soundcard though!
>
> It might, but I don't think it should, as the drivers
> in Windows should be enough (maybe :D)
>
> Mike.

Nope don't think it will unfortunately. Windows uses plug n play dll's etc. Dos wouldn't have a clue what they are.
roofus (483)
96289 2002-11-06 06:25:00 Do you need that sound to play, or will just a plain "beep" work. -=JM=- (16)
96290 2002-11-06 11:19:00 Thanks Brett for the solution, and others for the ideas.
Any idea how to automatically close the DOS window at the completion of the batch file as well?
Ian W (2457)
96291 2002-11-06 21:23:00 If you launch the batch file from a shortcut on the desktop, you can edit the shortcut (or perhaps it's the windows settings for the batch file) to terminate DOS window on completion.

Mike.
Mike (15)
1 2