LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-03-2006, 10:57 AM   #1
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Rep: Reputation: 15
Play music through SSH terminal?


We have a script that we run through an SSH command line to our CentOS server. I would like to have the script play a music file when it's finished. How do I do that?
 
Old 03-03-2006, 11:05 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
You can use mpg123/ogg123, plays an mp3/ogg on command line

If I understood correctly..
 
Old 03-03-2006, 11:34 AM   #3
sm1else
Member
 
Registered: Oct 2004
Distribution: At home: Ubuntu, Debian Sarge
Posts: 56

Rep: Reputation: 15
Am I right in thinking that you want the server to play a sound that is heard on the client speakers?
If thats the case then the Enlightened Sound Daemon (esd) is one way to do it. I cant remember how the client should be set up but this is the command I used to use on my server to send audio to the client:
Code:
esddsp --server=192.168.0.2:150 -m -v
 
Old 03-03-2006, 01:30 PM   #4
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Original Poster
Rep: Reputation: 15
I entered that command, and it put out this text:

[root@localhost ~]# esddsp --server=192.168.5.105 -m -v
server: 192.168.5.105
name:
command line:

I'm assuming the server IP is server, not client.

Then, when I try to play a file, I get this:

[root@localhost ~]# play Everybody\ Everybody.wav
sox: Premature EOF on .wav input file

I don't have mpg123 or ogg123, and up2date cannot find them. What should I do to make this work?
 
Old 03-03-2006, 03:42 PM   #5
sm1else
Member
 
Registered: Oct 2004
Distribution: At home: Ubuntu, Debian Sarge
Posts: 56

Rep: Reputation: 15
Sorry, forgot to mention that. The --server option is taken in the same context as in XServer for graphical displays. That means that its the machine which will output the sound to the speakers. For the same reason esddsp is run from the machine that will transmit the sound.

It's confusing but the way to remember it is that the client makes a request (e.g. Play this wav) and the server acts on it (e.g. The sound is sent to the speakers). To avoid this problem I'll use the names esdserver (the ssh client) and esdclient (the ssh server) when talking about the sound parts.

Looking through the man pages the esdserver needs to run 'esd' with some options to allow esdclients to connect to it. '-tcp -public -port 150' should be right.

So this should work on the esdserver (I hope):
Code:
esd -tcp -public -port 150
and for the esdclient:
Code:
esddsp --server=A.B.C.D:150 -m -v
where A.B.C.D is the IP of the esdserver
 
Old 03-06-2006, 01:59 PM   #6
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Original Poster
Rep: Reputation: 15
What commands should I use to activate the music?
 
Old 03-06-2006, 05:30 PM   #7
sm1else
Member
 
Registered: Oct 2004
Distribution: At home: Ubuntu, Debian Sarge
Posts: 56

Rep: Reputation: 15
In theory any program capable of using esd should work.
I was using gnome (over vnc and esd) so all sound went across the network.
For your purposes mpg321 (its an improved version of mpg123) should work since it claims esd support
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What to use to play music on Mandriva? Bakoulou Mandriva 7 12-12-2005 02:20 AM
Play Video and Music wordlife Linux - General 2 12-11-2005 04:52 PM
cant play music king kong killa Fedora 2 06-11-2004 09:36 PM
music cd doesn't play in cd player fobius Linux - Software 3 04-24-2004 10:31 AM
my music won't play JamDunc Linux - Newbie 4 08-03-2003 07:30 AM


All times are GMT -5. The time now is 08:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration