Link to home
Start Free TrialLog in
Avatar of tommoran
tommoran

asked on

Making an mp3 server to broadcast over intercomm system

I have an older pc that I want to turn into a mp3 server (sorta).  What it will do is just be barebones Redhat and have a text-based mp3 player that can be remotely administered via ssh.  this way I can just setup a smb share to the server to drop mp3 files and the player can then pickup a playlist from a directory and loop through all the songs.

Any ideas?  I've seen a few mp3 players for linux but I'm a little uncertain how to get it to run with very little user interaction.

Thanks in advance,
Tom
Avatar of kamichie
kamichie

Let me see if I understand what you want. You have some speakers hooked up to this other computer and you want to be able to copy mp3's from a folder on one computer to this one. I think this shouldn't be to diffucult, I think the major problem is finding  a console based mp3 player for linux, thus administartion through SSH is possible. Well thankfully sourceforge.net has all the answers. I have posted a link to their site that searche for console mp3. One of these tools should probaly fit your needs. Just install the console player, and wirtie a simple bash script to generate a playlist from the smb directory, then send the playlist to the console program.
Avatar of tommoran

ASKER

That's awesome.  Although I may need to repost for some help with that bash script you are suggesting.  I really like that idea though.  Thank you for the input.  I didn't see the link you posted but I am a bit familiar with sourceforge and so i'll try a search on the same terms.

Thanks
Found one called music on console.  Giving it a run for the money.  I'll post with my status.  I should be finished by the end of the day.
ASKER CERTIFIED SOLUTION
Avatar of kamichie
kamichie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what's wrong with mpg123?

mpg123 /mp3-dir/*

or:

#!/bin/bash
while true
do
  if [ -f /mp3-dir/ctrl/play ]
  then
    while true
    do
      for song in /mp3-dir/ctrl/playlist.txt
      do
         [ -f /mp3-dir/ctrl/play ] || break
         mpg123 /mp3-dir/$song
      done
    done
    [ -f /mp3-dir/ctrl/loop ] || break
    [ -f /mp3-dir/ctrl/play ] || break
  fi
  sleep 5
done



this will allow you to place a list of filenames as playlist.txt in the ctrl-directory.
A few seconds after placing a file called "play" in ctrl-dir, the player will start playing the songs on the list. when the file "loop" exists in ctrl-dir, the playlist will be played in an endless loop, as long as the file exists. When the "play" file gets removed, the player will stop after the current song.

just some creative input....

HTH,
-XoF-
That's pretty cool also.  One thing that music on console is able to do is add songs to the playlist on the fly.  For example, I have a smb share to the directory where the music on console gets it's playlist.  All I have to do is drop mp3's into that directory and with no intervention at all they are added to the playlist.  I think that's pretty dang cool.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thats a great idea, but was under the impression the user wanted a simple GUI accesable through SSH, so they could control the music from another PC.
You are correct kamichie and thus the reason I chose a text-based mp3 player.  Then I started to think about being able to just drop files into a smb share and have them automatically added to the playlist.  I still am tweeking it to play correctly but it seems it will work really well.  XoF was giving a great idea for the bash script that I eluded to in my previous post.  I'm sorry if I was too confusing in my post, I tend to do that sometimes.  Opening my mind up to alternatives is what I love so much about EE.