Aug 212007
 

Every time I need to do this, I forget where I found it. This information is copied from here.

Vorbis ogg:
vorbisgain -arfs *

mp3 (using mp3gain):
find -type d -exec sh -c "mp3gain \"{}\"/*.mp3" \;

mp4 and mp3:
find -type d -exec sh -c "mp3gain \"{}\"/*.mp3" \;

mpc:
find -type d -exec sh -c "mp3gain \"{}\"/*.mpc" \;

flac: just use the –replay-gain option when encoding or use the following (treating all the flacs as one album!):

find originals -name "*.flac" -type f -print0 | xargs -0 metaflac --preserve-modtime --add-replay-gain

or you can create the following small script and call it with the name of your base directory (/srv/music, or something like that). This will treat all songs in one directory as one album.
#!/bin/sh
basedir=${1:-.}

IFS="
"
for dir in `find $basedir -type d`; do
ls $dir/*.flac >/dev/null 2>&1 && metaflac --add-replay-gain $dir/*.flac
done

May 292005
 

I regularly check the SVN builds of Amarok my favorite music program (if you are using linux, go check it out). Since I also use Gentoo, I just needed to have a good ebuild for it. I found a very good file on the Amarok forums, but had some small problems with it (it did too much), so I made a small update.

If you are interested, here it is.

03/06 small update: on the Amarok forums someone pointed out that the same result could be achieved in a more elegant way. The download now points to the more elegant file.

06/08 update: Andrew pointed out that you need to update the ebuild with a couple of things. Please read the comments for the information. Personally I didn’t have any luck lately since the process now seems to need unsermake and QT4. I am working on that.