LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Play music through SSH terminal? (https://www.linuxquestions.org/questions/linux-software-2/play-music-through-ssh-terminal-421276/)

spiffytech 03-03-2006 10:57 AM

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?

nx5000 03-03-2006 11:05 AM

You can use mpg123/ogg123, plays an mp3/ogg on command line

If I understood correctly..

sm1else 03-03-2006 11:34 AM

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

spiffytech 03-03-2006 01:30 PM

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?

sm1else 03-03-2006 03:42 PM

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

spiffytech 03-06-2006 01:59 PM

What commands should I use to activate the music?

sm1else 03-06-2006 05:30 PM

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


All times are GMT -5. The time now is 08:31 AM.