Results 1 to 2 of 2

Thread: Executing an audio file from a shell session?

  1. #1

    Executing an audio file from a shell session?

    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

    #! /usr/bin/perl
    $name = 'ArKtik-A';

  2. #2
    Senior Member
    Join Date
    Nov 2001

    Re:Executing an audio file from a shell session?

    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.

Similar Threads

  1. Home Server Linux Shell in a box file sharing media centre
    By amlwwalker in forum Linux - General Topics
    Replies: 1
    Last Post: 12-20-2012, 10:45 AM
  2. record audio currently playing to a .wav file
    By seanmclemon in forum Linux - General Topics
    Replies: 2
    Last Post: 09-01-2003, 09:04 PM
  3. php session handling error
    By smokybobo in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 09-24-2002, 03:10 AM
  4. KDE session problem
    By t048 in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 02-16-2002, 05:18 PM
  5. My session with the Emacs psychiatrist
    By vee-eye in forum General Chat
    Replies: 16
    Last Post: 01-26-2002, 07:33 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts