tags:

views:

3072

answers:

3

I have some long running scripts with breaks requiring input/interaction to continue but when I switch to another window I'd like to be notified (by sound) that a task is complete and now awaiting input.

I would prefer to be able to play an audio clip (*.mp3, *.ogg, etc.) but wouldn't care if the only solution is to make the PC Speaker beep noise.

Any ideas? I'm open to any CLI utilities I can install that play sounds that in turn I can execute when needed.

FYI: My System is running WinXP Pro.

UPDATE: Doh! My Windows > Control Panel > Sounds > Default Beep: was set to (none). Grrr...

Problem solved.

+2  A: 

Try this:

echo ^G

(^G is obtained by ctrl+G).

Note: you can't copy and paste this code in a batch file, it won't work. To obtain a ^G character in a file, type in a cmd window:

echo ^G > beep.txt

(again, ^G is obtained by ctrl+G).

Then you'll have a file named beep.txt, open it with notepad, there will be a square character. This is our ^G once it is saved in a file.

You can then copy and paste it in a batch file to make a sound (don't forget to put "echo" in front of it).

FWH
no luck... do I need any special bash components for this to work?
scunliffe
We're talking about a .bat or .cmd file, right ?You said you're running windows XP, but you're talking about a "bash" script, which is a linux command interpreter.
FWH
It could be anything I guess... a *.sh, an alias, *.bat or *.cmd. I should clarify that I'm currently running an alias... which echos a bunch of calls to run *.sh scripts. So I could put the "sound" bit anywhere in there.
scunliffe
updated answer... My Windows Sounds for "default beep" were turned off.
scunliffe
In most shells (but not command/cmd), you need Ctrl-V Ctrl-G in order to type ^G.
ephemient
+5  A: 

This will make a beep from within bash

echo -en "\007"
Greg Reynolds
no luck either... :-(
scunliffe
updated my question... this works fine now... that my "default beep" sound in Windows is turned on.
scunliffe
A: 

copy con beep.bat [Enter]

@echo off [Enter]

echo [Ctrl+G] [Enter]

[Ctrl+Z] [Enter]

beep.bat [Enter]

naveen