Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Playing an Audio File with Batch File  (Read 3214 times)

0 Members and 1 Guest are viewing this topic.

Ravenholm

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows XP
    Playing an Audio File with Batch File
    « 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.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Playing an Audio File with Batch File
    « Reply #1 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?


    Ravenholm

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows XP
      Re: Playing an Audio File with Batch File
      « Reply #2 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.

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Playing an Audio File with Batch File
      « Reply #3 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.

      Ravenholm

        Topic Starter


        Rookie

        • Experience: Beginner
        • OS: Windows XP
        Re: Playing an Audio File with Batch File
        « Reply #4 on: October 20, 2009, 09:50:56 PM »
        I'm running a 65bit OS. Would that make a difference in any of this?

        JJ 3000



          Egghead
        • Thanked: 237
        • Experience: Familiar
        • OS: Linux variant
        Re: Playing an Audio File with Batch File
        « Reply #5 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?
        Save a Life!
        Adopt a homeless pet.
        http://www.petfinder.com/

        Ravenholm

          Topic Starter


          Rookie

          • Experience: Beginner
          • OS: Windows XP
          Re: Playing an Audio File with Batch File
          « Reply #6 on: October 20, 2009, 11:09:17 PM »
          lol, typo. My bad.

          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: Playing an Audio File with Batch File
          « Reply #7 on: October 21, 2009, 10:05:05 AM »
          Is it a long file?