Martin Cooper's Linux Blog

All things Linux …

Monthly Archives: February 2012

mp3gain

I normally use the GUI version of this program to level the gain on mp3 music files but I wanted to do the same job automatically in a small script to level out all my podcasts in their seperate folders prior to loading them onto my mp3 player.

The values I use are;

-c : ignore clipping
-p : preserve file modification time
-r : apply Track gain
-d 6.0: makes it 95.0 dB (defaults to 89.0)

The script I use moves to the main Podcast folder then line of script finds all mp3’s in the sub-folders with it.

$ cd /home/martin/Podcasts

$ find . -name *.mp3 -exec mp3gain -c -p -r -d 6.0 ‘{}’ \;

This then levels out the gain on all podcasts to 95db.