playing a .wav file...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to play a .wav file in a batch file, but without windows media
player opening up? Just want to play the .wav file with no windows opening up
or if possible not even minimized. Thanks
 
Google killed my first response, here is the very short version (if it
works):

..\Runprocess.exe /k:30s SndRec32.exe /play /close /embedding
"sound.wav"

Bye,
Dennis Bareis
 
Making a beep
To make a beep in MSDos mode use echo followed by Ctrl + G, at the dos command prompt

echo ^Gor in a batch file use Ctrl P Ctrl G (Edit.com uses Ctrl + P to tell it the next key is a control key). In Windows use

Start C:\WINDOWS\MEDIA\NOTIFY.WAVor

mplayer2 /play /close C:\WINDOWS\MEDIA\NOTIFY.WAV
 
Royce said:
Is there a way to play a .wav file in a batch file, but without
windows media player opening up? Just want to play the .wav file
with no windows opening up or if possible not even minimized.

30306 Jul 12 21:57 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
scmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

92) How do I play a sound from the command line?

The simplest way to emit a brief beep is
@echo <Ctrl-G>
How to enter the ASCII 7 character depends on your editor program.

If you can get hold of QBASIC it has a PLAY statement. For example
@echo off & setlocal enableextensions
set bas_=%temp%\tmp$$$.bas
%bas_% echo PLAY "l8 o3 cdefgab o4 cd"
qbasic /run %bas_%
for %%f in (%bas_%) do if exist %%f del %%f
endlocal & goto :EOF

The Sound Recorder can be used to play a Wave Audio Sound file
(.WAV). For example
sndrec32.exe /play /close %SYSTEMROOT%\Media\tada.wav

References/Comments:
http://support.microsoft.com/kb/q168789/
http://www.google.com/[email protected]
http://www.google.com/[email protected]


All the best, Timo
 
Royce said:
Is there a way to play a .wav file in a batch file, but without
windows media player opening up? Just want to play the .wav file
with no windows opening up or if possible not even minimized.
[snip ^G methods]
The Sound Recorder can be used to play a Wave Audio Sound file
(.WAV). For example
sndrec32.exe /play /close %SYSTEMROOT%\Media\tada.wav
[snip]

The OP asked for a method to play a WAV file which would not open a
player window. I think no on-board program can do that.

There are many command line media players available. My preferred CLI
(4NT) has even an internal command -PLAYSOUND- which can play
synchronously or asynchronously (see
<http://jpsoft.com/help/playsound.htm>).

As for on-board programs: in addition to sndrec32 there's mplayer2 which
takes the same switches, but its path is not well defined. My favourite
is
RUNDLL32 AMOVIE.OCX,RunDll /play /close %SYSTEMROOT%\Media\tada.wav
However, it only takes short filenames, which is a bit of a problem
under CMD.EXE, and these two also show a window.
 
Michael said:
Royce said:
Is there a way to play a .wav file in a batch file, but without
windows media player opening up? Just want to play the .wav file
with no windows opening up or if possible not even minimized.
[snip ^G methods]
The Sound Recorder can be used to play a Wave Audio Sound file
(.WAV). For example
sndrec32.exe /play /close %SYSTEMROOT%\Media\tada.wav
[snip]

The OP asked for a method to play a WAV file which would not open a
player window. I think no on-board program can do that.


not as such, but it's less intrusive to prefix the command with Start /min
e.g.
start /min sndrec32 /play /close c:\windows\media\notify.wav
 
Is there a way to play a .wav file in a batch file, but without windows media
player opening up? Just want to play the .wav file with no windows opening up
or if possible not even minimized. Thanks


See tip 9242 » How can I hide a batch window?
in the 'Tips & Tricks' at http://www.jsifaq.com

Then:

hidebatch sndrec32 /play /close "C:\WINDOWS\Media\Windows XP Startup.wav"
 

That may the same or similar to playwave.exe (Inteletek)

I would mention (for free 3rd-party utils),
wav.exe (wav.zip - http://archives.thebbs.org/ra121c.htm )
which has more options (Repeat, Volume, ESC to terminate) and can
play more than just .WAV files. Uses MCI.

WAV.EXE v2.65 - Command line audio file player
Copyright (c) 1998-2001 by WebGeek, Inc.

Usage: WAV filename[.wav] [/Q] [/Rn] [/Vn]

/Q Quiet mode - no header is displayed
/Rn Repeat 'n' times
/Vn Volume level

If no file extension is specified, .WAV is assumed.

WAV.EXE will continue playing the audio file until it finishes,
or the user presses the Esc key.
 
Mark V wrote:
[]
I would mention (for free 3rd-party utils),
wav.exe (wav.zip - http://archives.thebbs.org/ra121c.htm )
which has more options (Repeat, Volume, ESC to terminate) and can
play more than just .WAV files. Uses MCI.

WAV.EXE v2.65 - Command line audio file player
Copyright (c) 1998-2001 by WebGeek, Inc.
[]

it's gone awol;
ftp://archives.thebbs.org/elebbs_utils/wav.zip
gives 404

another hit gave
http://www.basicguru.com
which is also dead

but an older alternative exists at
http://www.powerbasic.com/files/pub/pbwin/tools/WAV.zip
(no commandline options)

ah! found it!
http://www.cmdtools.com/files/wav.zip
 
In said:
Mark V wrote:
[]
I would mention (for free 3rd-party utils),
wav.exe (wav.zip - http://archives.thebbs.org/ra121c.htm )
which has more options (Repeat, Volume, ESC to terminate) and can
play more than just .WAV files. Uses MCI.

WAV.EXE v2.65 - Command line audio file player
Copyright (c) 1998-2001 by WebGeek, Inc.
[]

it's gone awol;
ftp://archives.thebbs.org/elebbs_utils/wav.zip
gives 404

Funny, I just d/l it from there to confirm.
ftp://archives.thebbs.org/elebbs_utils/wav.zip

2005-08-24 10:53 15,689 wav.zip
f7a6b3b2f2ad4b44e5b569cdb2107d31 *wav.zip


[ ]

I did not realize CMDTOOLS had it. Thanks.

Both wav.exe are identical and the same version, 2.65
 
Michael Bednarek said:
Royce said:
Is there a way to play a .wav file in a batch file, but without
windows media player opening up? Just want to play the .wav file
with no windows opening up or if possible not even minimized.
[snip ^G methods]
The Sound Recorder can be used to play a Wave Audio Sound file
(.WAV). For example
sndrec32.exe /play /close %SYSTEMROOT%\Media\tada.wav
[snip]

The OP asked for a method to play a WAV file which would not open a
player window. I think no on-board program can do that.

WSH/VBScript can be used to run it hidden.

Set WshShell = WScript.CreateObject("WScript.Shell")
sound = """C:\path_to\My wave file.wav"""
WshShell.Run "sndrec32 /play /close " & sound, 0, true
 
Back
Top