Sunday, January 27, 2008

irritating script

I've just hooked up a pair of speakers to the server-box which happens to exist in my living room.
note: This placement is due to primarily to poor planing on the apartment layout and our furniture choices, forcing me to keep the wireless router, cable modem and server(which is a small box, fortunately) all under the coffee table which sits between two chairs.

Bottom line: I now have sound coming out of this box, but the speakers are hidden under the table.
I doubt that it'll work very well, but I can now make sounds come out from (apparently) nowhere.
so I wrote this script:

iterate=5
wait=3
if [ $# = 2 ]
then
iterate=$1
wait=$2
fi
for (( i = 0 ; i < $iterate ; i++ ))
do
sleep $wait
mplayer cricket_1.wav
done

which plays a sound file repeatedly, based on the arguments that you give it. If none are supplied, it'll just play defaults of a 3 second wait, five times over.
This could get creepy, if I do it right.
Also, I can now use it to play my music library through some reasonable speakers

No comments: