Feb 08 2008

Stream your music with musicindex

Published by Jon under Linux

One thing I wanted to do is to be able to access my music library at home from anywhere. I also wanted it to be streamed so I do not have to download the files before I can play them.

Well, the apache module musicindex makes it very simple if you already have an apache web server running. All you need to do is to tell it where your music files are located and it will create a very friendly web interface that will let you browse, search, download and most importantly stream your music files.

Screenshot - Musicindex

Here are the instructions under Debian etch.

First, install the apache module musicindex:

# apt-get install libapache2-mod-musicindex

Then enable the module in apache:

# cd /etc/apache2/mods-enabled/
# ln -s ../mods-available/musicindex.load

Then, open /etc/apache2/httpd.conf with your favorite text editor and add the following. Note that I created a new subdomain (mymusic.mydomain.com) for that purpose only:

<VirtualHost *:80>
ServerName mymusic.mydomain.com
DocumentRoot /path/to/mymusic.mydomain.com
</VirtualHost>
<Directory "
/path/to/mymusic.mydomain.com">
Options Indexes MultiViews FollowSymlinks
AllowOverride Indexes
# Can be overriden in .htaccess
MusicIndex On +Stream +Download +Search -Rss -Tarball
MusicSortOrder album disc track artist title length bitrate freq filetype filename uri
MusicFields track title artist length bitrate freq filetype
# MusicPageTitle Myname
MusicDefaultCss musicindex.css
# Can only be set in apache configuration
MusicDefaultDisplay HTML
MusicIndexCache file://tmp/musicindex
# MusicIceServer [ice.domain.my]:8000
# MusicCookieLife 300
# MusicDirPerLine 3
</Directory>

Then, restart apache:

# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start

You are done. Just open any browser to your new site (mymusic.mydomain.com) and stream your music on demand from anywhere. Enjoy!

No responses yet

Feb 08 2008

Convert your MP3 files to Ogg Vorbis with mp32ogg

Published by Jon under Linux

Recently, I wanted to convert all my MP3 music library to the more open Ogg Vorbis format. I also wanted to reduce the bitrate (from 320 kbps to 156 kbps) so I can stream my music over the internet even with a low speed connection. I know, I know, converting from a lossy format to another lossy format is not recommended and it decreases the audio quality. Anyway, it did a pretty good job and I am very pleased with the results.

So I searched the web and found a very useful script called mp32ogg. That script can convert a whole directory tree recursively. You can choose the desired quality and it will also transfer the meta information (artist, album, track, song title, etc). It even lets you change the file name according to the meta information and will also delete the old mp3 files if you want to. It is a simple Perl script and it is easy to modify to fit your needs if you need to. Here is how to do it in under Ubuntu.

First you need to install it

sudo apt-get install mp32ogg

Then just use the script on the directory containing files you want to convert. The following command will also delete old mp3 files:

mp32ogg --delete --quality=5 <path-to-mp3-directory>

That’s it, you are done. Just wait for the script to finish converting all your library. For more options, just type:

mp32ogg --help

Have fun!

7 responses so far

Feb 05 2008

Hello world!

Published by Jon under Life of Jon

Yeah right! Finally had time to pull that site out of my “idea incubator”.

Still needs some work on the theme!

2 responses so far

« Newer Entries