How can I easily stream a server directory of MP3s?
March 1, 2010 10:10 AM   Subscribe

I have a CentOS server with a directory of some MP3s. What is the easiest way to have a radio stream setup so I can listen to them at work or on my phone? I looked at Shoutcast and it seems perfect, but I can't seem to figure out how to get it to randomly pick something from a directory of music instead of connecting to Winamp on a host machine.
posted by ilikebike to Computers & Internet (12 answers total) 4 users marked this as a favorite
You want Simplify Media

posted by TheNewWazoo at 10:13 AM on March 1, 2010

You should be able to use shoutcast with its on demand feature, as described here under "Advanced topics"
posted by beerbajay at 10:19 AM on March 1, 2010

Also, here.
posted by beerbajay at 10:22 AM on March 1, 2010

I'm happy with Jinzora2.
posted by valadil at 11:16 AM on March 1, 2010

I've used Squeezebox Server before Squeezebox was bought by Logitech. It would provide a radio stream you could listen to with a web interface to control playback. I haven't used this in a while so YMMV.

I also never got it to work on a phone but its a standard MP3 stream so it should work.
posted by bitdamaged at 11:23 AM on March 1, 2010

Response by poster: For Simplify and Squeezebox, I'm not sure if these are exactly what I'm looking for. I want to create a stream that just randomly pulls a file from a directory and plays it. I don't want to select tracks necessarily or have any sort of interface, just a stream. I don't want to touch my home collection, or have it transmit my music on my computer to the internet. Just a directory of music, broadcast randomly on a simple stream.
posted by ilikebike at 12:32 PM on March 1, 2010

Squeezebox allows you to pick your music directory and then scans it. You can then just set up a "playlist" based on all songs and play it back with random and repeat and get the functionality you're looking for. I'd assume simplify is similar.

There may be some sort of command line tool to do this, but having the UI there is nice for setup and once its going you wouldn't have to look at it again.
posted by bitdamaged at 1:25 PM on March 1, 2010

Using Simplify for the iPhone, there's a "shuffle" option at the top of every screen, but it'll shuffle based on all, artist, album, or playlists. So, not based on the filesystem. Not sure about the desktop client.
posted by TheNewWazoo at 1:25 PM on March 1, 2010

Are you running Apache or any other web server on the CentOS box? If so, it should be pretty easy to write a script in the language of your choice to return a random file from a directory. The script would go something like:

1) get a list of all the files in (directory), stuff the filenames into an array
2) generate a random integer between 0 and length(array)-1
3) return file using a 200 status code, a mime-type of audio/mpeg, and the filename from the random index of the array created in step 1. There is usually a function in any scripting language to return a file.

Then create a bookmark in Safari to point to the URL of the script and you should be done.
posted by helios at 2:55 PM on March 1, 2010

Ampache may be overkill, since it also has an interface and allows you to select playlists, songs, etc., but it does what you want, and it's pretty easy to get set up. Works beautifully, too.
posted by dilettanti at 3:38 PM on March 1, 2010

Response by poster: This is not a home server. This is my web server, serving various wordpress sites and hosting multiple domains. I don't own an iPhone and cannot use any iPhone apps.
posted by ilikebike at 6:40 PM on March 1, 2010

Have you considered using a DAAP? Even though Apple fused it with zeroconf to make it work on local subnets only, this is really the use case it was invented for.
posted by themel at 11:19 PM on March 1, 2010

« Older I need some information on marking up documents on...   |   On second thought, I do want a billboard made of... Newer »
This thread is closed to new comments.