• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

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
0
tommoran
Asked:
tommoran
  • 4
  • 3
  • 2
2 Solutions
 
kamichieCommented:
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.
0
 
tommoranAuthor Commented:
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
0
 
tommoranAuthor Commented:
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.
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
kamichieCommented:
Your bash script should be relatively simple, just mess with the mp3 console program, and their should be some option like "mp3console -generateplalist /usr/mp3 /home/me/plist.plt" then another command
like "mp3console -playlist /home/me/plist.plt". Do not take these literally, these are just examples of made up commands. Once you have all the commands down, you can create a bash script. A bash script is exactly like a batch file for DOS/Windows. Just put the commands you want to execute in a file and run it. However Linux has some funny rules, first the extension doesn't matter there is actually a flag you have to set with chmod to make the file executable. I think it's chmod 777, and also make sure to fully qualify your locations like "/usr/bin/mp3console -generateplaylist". Googling bash scripts will give you quite a few useful tutorials.
0
 
XoFCommented:
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-
0
 
tommoranAuthor Commented:
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.
0
 
XoFCommented:
oops, error:

replace
for song in /mp3-dir/ctrl/playlist.txt
with
for song in $(cat /mp3-dir/ctrl/playlist.txt)

Alternative (without playlist-file):

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


Now it simply plays all songs in /mp3-dir. Just drop songs there, they will be played automatically in the next loop....


cheers,
-XoF-
0
 
kamichieCommented:
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.
0
 
tommoranAuthor Commented:
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.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now