Wuzzup My linux buddies. I'm a proud new member of the Linux Society, since my newly aquired job has me ssh'd into customers machines all day. Anyways, I have a windows machine and a redhat machine that I have on a lan. My question ??? is this, how would I execute an audio file from a shell prompt? I'm also a newbie to Perl programming, and the new script idea I have will require me to open several audio files when called upon. So I just need to know how to play the damn things from the shell!
I'm a newbie to linux/shell sessions, so please don't beat :-X me bloody for asking a dumb question like this! Thanks in advance guys! ;D
$name = 'ArKtik-A';
If it's just a WAV file, you can use the "play" command. If it's an mp3, try mpg123 or mpg321. If it's an ogg vorbis file, try ogg321. The drawback? I believe all of these solutions will play the sound on the machine you are ssh'd to rather than back through your ssh session to your local machine.
I have a couple of shell scripts that use the play command to play a wave file of me saying "Get out of my office" that I trigger when I'm at work and notice the kids are playing with the keyboard on my server again It was effective for the first day, but after that they thought it was funny, so I quit using it.
If that's what you had in mind (running the sound on the machine you're connected to, not playing it from that machine to yourself) then that's the list of CLI tools I know of. If you want to play the sound on your end but stream it from the computer you're connected to, you'll need to set up some system for streaming audio... or set up a client/server system. You could run a listening server on the system you want the alarms to be played on, and have your CLI scripts use a client program to trigger the alarm. I had a system like this as well where if someone came in a certain chat room where I had a custom perl irc bot I wrote sitting, then they could type "!page" and if I wasn't on, and it hadn't tried to page me in the last 10 minutes, it would use the smbclient to do a "net send" style message to my laptop and I'd get a popup to interrupt my work so I'd know someone needed me I had to put the 10 minute buffer in there to keep it from being abused... one of my friends use to try to page me 50 times in one minute and it got to be annoying.
Hope this helps and gives you some ideas about how you can go about doing what you want to do with your system.