Computing.Net > Forums > Programming > Putting Sound in a batch file

Putting Sound in a batch file

Reply to Message Icon

Original Message
Name: hatlad
Date: June 15, 2007 at 05:36:01 Pacific
Subject: Putting Sound in a batch file
OS: windows xp
CPU/Ram: intel processor 512 mb RA
Model/Manufacturer: DELL
Comment:

I have a hobby of making batch files and was wondering if it is possible to use sound in a batch file. If so, can you tell me how?

I hope you can help!


Report Offensive Message For Removal


Response Number 1
Name: tonysathre
Date: June 15, 2007 at 16:26:24 Pacific
Reply: (edit)

Yes you can. This is how I've done it:

cd /d "%programfiles%\videoLAN\VLC"
start /min vlc "%systemroot%\media\tada.wav" vlc:quit

You have to have VLC installed.

"Computer security." — Oxymoron


Report Offensive Follow Up For Removal

Response Number 2
Name: Razor2.3
Date: June 15, 2007 at 17:12:20 Pacific
Reply: (edit)

Something that'll work with a clean Windows install:
start "" /min mplayer2 "Sound File" /play /close


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: June 15, 2007 at 23:03:43 Pacific
Reply: (edit)

or, more simply:

d:\folder\filename.wav


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 4
Name: Razor2.3
Date: June 15, 2007 at 23:33:58 Pacific
Reply: (edit)

Well, if you really wanted to load the bloated WMP...


Report Offensive Follow Up For Removal

Response Number 5
Name: Mechanix2Go
Date: June 16, 2007 at 00:18:26 Pacific
Reply: (edit)

It uses whatever app is 'assocuated' with the file. In my case, VLC for wav; MusucMatch for MP3 and m3u; and so on


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal


Response Number 6
Name: Razor2.3
Date: June 16, 2007 at 00:28:34 Pacific
Reply: (edit)

Yeah, and MPC's my player of choice. But we're not exactly "normal" Windows users, are we?


Report Offensive Follow Up For Removal

Response Number 7
Name: Mechanix2Go
Date: June 16, 2007 at 01:08:27 Pacific
Reply: (edit)

I'm not sure what 'normal' is, but I guess I'm not it. LOL


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 8
Name: hatlad
Date: June 16, 2007 at 06:32:20 Pacific
Reply: (edit)

Thank you all!

I hope you can help!


Report Offensive Follow Up For Removal

Response Number 9
Name: hatlad
Date: June 16, 2007 at 06:39:34 Pacific
Reply: (edit)

I just discovered a problem,
When I tried the advice from response 3 it said "Device not ready"

I hope you can help!


Report Offensive Follow Up For Removal

Response Number 10
Name: hatlad
Date: June 16, 2007 at 06:51:15 Pacific
Reply: (edit)

This is wahat i typed in:

@echo off
d:\"C:\Documents and Settings\Jim\My Documents\Misc\Applications\beep1.wav"
pause

(the path is on one line actually)
I hope you can help!


Report Offensive Follow Up For Removal

Response Number 11
Name: Mechanix2Go
Date: June 16, 2007 at 07:14:33 Pacific
Reply: (edit)

You need to lose the d:\

meaningless

"C:\Documents and Settings\Jim\My Documents\Misc\Applications\beep1.wav"


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 12
Name: hatlad
Date: June 16, 2007 at 07:53:07 Pacific
Reply: (edit)

Thank you. But is there a way that the sound just plays without having to open up a program. (Tell me if I am not specific)

I hope you can help!


Report Offensive Follow Up For Removal

Response Number 13
Name: Mechanix2Go
Date: June 16, 2007 at 10:39:39 Pacific
Reply: (edit)

"is there a way that the sound just plays without having to open up a program"

no


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 14
Name: hatlad
Date: June 16, 2007 at 11:42:46 Pacific
Reply: (edit)

Thank u all 4 your help! (sorry if u think I was wasting ur time)

I hope you can help!


Report Offensive Follow Up For Removal

Response Number 15
Name: Razor2.3
Date: June 17, 2007 at 01:19:00 Pacific
Reply: (edit)

Actually, it's a hack, but there is a way. I'm hesitant to mention it, because it leaves an uncloseable copy of WMP running:

@echo CreateObject("WScript.Shell").Run "wmplayer " ^& Chr(34) ^& "Sound file here" ^& Chr(34), 0 > a.vbs
@a.vbs //nologo

Yeah, it opens up a program (two of them, actually), but graphically, the user can't tell.


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Putting Sound in a batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge