Computer Hope

Microsoft => Microsoft Windows => Windows Vista and 7 => Topic started by: Ravenholm on October 20, 2009, 07:53:41 PM

Title: Playing an Audio File with Batch File
Post by: Ravenholm on October 20, 2009, 07:53:41 PM
Can someone help me out with this? I don't know what I'm doing wrong.

I put:
Quote
mplay32 /play /close c:\Users\Connor\Desktop\abc.wav
into notepad and name it file.bat

but it's not working.
Title: Re: Playing an Audio File with Batch File
Post by: Geek-9pm on October 20, 2009, 09:19:44 PM
May I suggest something. When ever you have a problem with batch files, it helps to simplify things and make them more direct. You should have received some type of error message if the Windows media player was not available, or could not find the file.
Just now I made a new audio file that I called "test.wav" and after adjusting the volume level and effects, I placed it in an empty directory on the C: drive. I had named the directory WAV so  now the new audio file I just created is in that directory.

So now this is what I do at the command prompt.
C:\WAV>mplay32 /play /close TEST.WAV

Works fine for me.
Can you duplicate this on your system?

Title: Re: Playing an Audio File with Batch File
Post by: Ravenholm on October 20, 2009, 09:31:25 PM
Hmmm ok, I put a folder named wav in C, I put my .wav file into it(it's named ABC), I wrote, "C:\WAV>mplay32 /play /close abc.WAV" in wordpad, saved it as wavplay.bat. When I click it it opens a DOS window and closes too fast to read, and it put a file that's not associated with anything on the desktop. The file is named mplay32. I don't know what the problem is.
Title: Re: Playing an Audio File with Batch File
Post by: Geek-9pm on October 20, 2009, 09:48:18 PM
OK. I ran it directly from the command line.
here is a BAT files I make and put in the same directory.
Quote
mplay32 /play /close TEST.WAV

I am using XP. It runs fine in the batch file when i run the file inside of Windows Explorer. It opens a DOS window (Command box) and runs the wmp and at the end of the files it closes.
Note. Make sure any other audio programs are not active.
Title: Re: Playing an Audio File with Batch File
Post by: Ravenholm on October 20, 2009, 09:50:56 PM
I'm running a 65bit OS. Would that make a difference in any of this?
Title: Re: Playing an Audio File with Batch File
Post by: JJ 3000 on October 20, 2009, 10:20:20 PM
I'm running a 65bit OS.

Really? I didn't know that you could do that. What's it called?
Title: Re: Playing an Audio File with Batch File
Post by: Ravenholm on October 20, 2009, 11:09:17 PM
lol, typo. My bad.
Title: Re: Playing an Audio File with Batch File
Post by: Geek-9pm on October 21, 2009, 10:05:05 AM
Is it a long file?