How can I play a sound file from a Windows batch file?
Hello to all,
I am new to this forum. I know how to create batch file. I just want to know that is it possible to play a sound file from a Windows batch file. If yes, then can anyone tell me how can I play a sound file from a Windows batch file? Please help me.
Thanks in advanced.
Re: How can I play a sound file from a Windows batch file?
If you want to play sound file like wave file (*.WAV) from Windows batch file then you have to use following command.
If you are using Windows 95, then use following command:
mplayer.exe /play /close <wave file>
For example:
mplayer.exe /play /close c:\windows\ringtone\nokia.wav
If you are using Windows NT, then use following command:
mplay32.exe /play /close <wave file>
For example:
mplay32.exe /play /close c:\winnt\ringtone\IPL.wav
Re: How can I play a sound file from a Windows batch file?
Hey you can play a sound file from a Windows batch file by using Windows mplay32.exe or mplayer.exe file. These are included with Microsoft Windows, which is used to play Windows sound files.
If you are using Windows 95 and 98 then you must use mplayer instead of mplay32. You can do this in the following ways.
mplay32 /play /close c:\windows\media\chimes.wav
In the above code I have use mplay32 as the program to play the file.
Re: How can I play a sound file from a Windows batch file?
as per my knowledge you can play a sound file from a Windows batch file using
mplay32.exe or mplayer.exe file. Just try to understand following example.
mplay32 /play /close "c:\windows\media\Nokia.wav"
In the above code I have give path of sound file. This is media player is only able to play .wav, .mid, *.cda, *.avi, *.asf files. You can not play .mp3 file.
Re: How can I play a sound file from a Windows batch file?
Hey if you are want to play mp3 file from a Windows batch file, then you have to use start command. It means if you wanted to open media player that can play 'rehnas.mp3" in the batch file then you have to use following code:
start music.mp3.
Note: This will open your default media player.