Philip Jacob

Streaming Music From Home to Work

· Philip Jacob

People at work have noticed that I am able to stream my music collection on a server at home to my desktop at work. Here’s the short hack that does the streaming… it’s just two php files and a css file:

  • browse.php - lets you browse through directories
  • stream.php - starts a stream with mime-type audio/mpegurl
  • streamer.css - a little CSS for small readable fonts

I have about ~75Gb of mp3s that I have accumulated through the years (ironically, I actually have about 5 boxes of CDs in the attic to support the legality of my collection). The mp3s are stored on a Debian Linux server in the basement. I manage the mp3s using Apple’s iTunes from my Windows laptop connected to the file server via Samba. I have Apache and PHP on the Linux box as well. From work, I just hit a URL with my browser, click ‘stream’ and listen using Windows Media Player. If you look at the code, you’ll notice that it performs character set conversions from CP850 (which is how the files are stored on the Samba server) to ISO-8859-1 (which is what makes all the diacritic chars display properly).

Works well enough for me. I tried Jinzora once. It looks great, but I couldn’t get it to work for some reason. Maybe you will have better luck.