Improved Loudness Correction With EBU R128

Mix by Niels Linneberg, on Flickr Creative Commons Attribution-Noncommercial-Share Alike 2.0 Generic License by  Niels Linneberg

Music mastered at different levels can be a pain when you’re a dj, as well as when listening to music at home. The great differences in loudness levels is in part due to what is sometimes called the “Loudness War”, but sometimes it is just inconsistent between different issuers. As long as you listen to a CD/compilation as it was designed from the issuer, there is no problem, it is when you start mixing tracks from different sources that the volume starts jumping up and down…

I have used ReplayGain to adjust automatically to a target volume level, and it has served me well. It’s not perfect, though, so I read with great interest about efforts to create tools to implement the EBU R128 standard which is supposedly a better technology for achieving basically the same goal. ReplayGain works very well within music with more or less the same sonic spectrum in my experience, but tended to play modern recordings with lots of bass louder than older music like golden age tango music to pick a completely random example. This would even be noticeable between early and late Di Sarli for instance, not that I would play them together in the same tanda, but just to give you an idea. Much better than random jumping up and down, but with room for improvement.

Two projects were announced at approximately the same time, R128gain and libebur128. I did a little testing with libebur128, and the preliminary results are very promising. I now got my music collection basically converted to using R128 in place of ReplayGain. I also compared the gain values generated with ReplayGain and R128, and it verified my impression that typical pop music will be played back at lower volume, relatively, than before, and typical golden age tango material will be played louder.

To tag my main collection, which resides on a Linux box, I used a small bash script to recursively tag all flac files directory by directory:

find . -type d|
while read dir; do
./r128-sndfile -t ./ "$dir/"*.flac

This assumes you got the r128-sndfile executable in the directory you need to tag.

EDIT: There is now a foobar2000 scanner available as well.

EDIT: The new version of foobar2000 (1.1.6) incorporates the libebur128 library for scanning of replaygain values. Libebur128 is now hosted at github The new version (0.4) does not use the python script anymore, and supports recursive tagging natively.

comments powered by Disqus