Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How can I play a sound file from a Windows batch file?

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-03-2010
Member
 
Join Date: Nov 2009
Posts: 57
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.

Reply With Quote
  #2  
Old 27-03-2010
Member
 
Join Date: Apr 2008
Posts: 3,516
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
Reply With Quote
  #3  
Old 27-03-2010
Member
 
Join Date: Apr 2008
Posts: 3,288
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.
Reply With Quote
  #4  
Old 27-03-2010
Member
 
Join Date: Nov 2005
Posts: 3,022
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.
Reply With Quote
  #5  
Old 27-03-2010
Member
 
Join Date: Nov 2005
Posts: 1,203
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.
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How can I play a sound file from a Windows batch file?"
Thread Thread Starter Forum Replies Last Post
Windows Batch file to output directory names and size to txt file m2thearkus Software Development 6 16-07-2010 12:04 AM
Windows Media Player cannot play file because there is a problem with your sound device. dimpy00 Media Player 1 29-06-2010 04:33 AM
Windows Media Player cannot play the file because there is a problem with your sound device rEDNESS Media Player 5 08-10-2009 01:09 AM
Batch file to copy a file from the local drive to a computer on lan? dudelearn Tips & Tweaks 3 12-03-2009 12:56 PM
How can I play a Wav file from batch/cmd script? NaFula Windows Vista Performance 3 13-09-2008 09:21 PM


All times are GMT +5.5. The time now is 11:30 AM.