Id3Gain (v1.0)

by Alexander Thomas (aka Dr. Lex)

What is it?

This command-line program calculates ReplayGain volume adjustments for MP3 files and stores the values in the file's ID3 tag, for use by players like Rockbox. Unlike MP3Gain, the MP3 stream is completely unaltered. Id3Gain uses ‘TXXX’ tags with labels like “replaygain_track_gain” to store the gain information. The drawback is of course that your MP3 player must support those tags, otherwise they won't have any effect.
Id3Gain can also update the Sound Check volume adjustment used by iTunes to the more accurate ReplayGain value, with the option to use album gain instead of track gain.

What is ReplayGain?

ReplayGain is an open source variant of the “Sound Check” feature built into iTunes. In other words, it calculates an optimal volume adjustment such that every song plays at the same perceived loudness. Because ReplayGain analyzes the entire file while Sound Check only seems to sample some parts of the song, ReplayGain generally gives much better results. I have seen cases where the Sound Check adjustment differred more than 7dB from the RG value, amounting to more than a doubling or halving of the volume. I have never encountered a case where Sound Check gave a more correct sounding result than RG. In newer versions of iTunes, the accuracy of Sound Check seems to have worsened to a point where it has become useless, probably because the algorithm was further cannibalized to make it even faster. The result is that it doesn't really matter if SC is enabled or not: it will only change the distribution of too loud and too silent songs, without doing any useful volume equalisation. It just randomises the volumes. ReplayGain on the other hand really works.

Some Assembly Required

This is not a polished, streamlined program with a glossy interface. It's a bare command-line tool. In fact, unless you're using OS X on an Intel CPU, what you'll download is not even that: I only provide source code to avoid having to maintain binary releases for different platforms. To compile and run Id3Gain, libMAD and libid3tag are required.

Moreover, if you're going to use this together with iTunes, especially if you want to port the ReplayGain adjustment to iTunes' Sound Check, you'll have to follow some strict recipes to make it work (the README file mentions the word “voodoo”). If you want an easy-to-use but non-free solution that does the same, you may want to have a look at iVolume instead.

If you only want to use Id3Gain to calculate ReplayGain for use with RockBox or another media player, you might get away with just compiling the program and reading the built-in help (switch '-h'). But if you want to use it together with iTunes, you must read the README. Believe me, it's for your own good.

Download

Download the source code (bzipped TAR archive, 53KiB)

A precompiled binary is included for Intel OS X but I can't guarantee that it'll work. If it doesn't, or you're using a different platform, you will need to compile the program yourself. Read the included README file for instructions. The program includes a basic Makefile and a CMakeLists.txt file for easy compilation with CMake. Some helper scripts are also included, to work around possible problems when using id3gain together with iTunes.

Disclaimer

Id3Gain is released under the GPL. This software is provided "as is", without any implied warranty or claim of fitness for a particular purpose. Use of this software is completely at your own risk.