Normalize volume in Linux | 17th May, 2009

No responses

As most of you would have already known, the new amarok 2.1 has built-in support for replay gain.

What is replaygain?

The volume of different songs in your collection may vary quite a bit needing manual change in volume every time the song changes (If you don’t want to go deaf that is) . Replay gain analyzes the songs in your collection and writes a special gain tag into the song metadata. Replay gain supported audio players can analyze this tag and automatically adjust the volume so that all the songs are played at almost equal volume.

But amarok does not automatically write the replay gain values for you. You have to use some other tools like mp3gain. Here’s the trick to normalize all the volume of all your tracks at one go

find . -iname '*.mp3' -execdir mp3gain -a -k "{}" + &

Run this in the root of your music directory (Its a good idea to run this overnight if you got a large music collection) and your are done!

Here’s the explanation of the command – “find . -iname ‘*.mp3′” searches for all mp3 files. -execdir executes the command on a directory basis. The -a switch to mp3gain tells mp3gain to use Album gain instead of Track gain (very important!), and the -k tells mp3gain not to increase the volume so much that there’s distortion in playback. Also note that the changes made by mp3 gain are completely lossless and reversible.

You also need to have a compatible audio player to interpret the tags. Some of them include

Filed under Tutorials, linux.

Sponsors:

No responses

Leave a Reply

* Required (But your email address will be never published)