linux/scripts

Welcome to encomiabile.it
“Gather ye rosebuds while ye may, old time is still a-flying. And this same flower that smiles today tomorrow will be dying” (Dream Theater - A Change of Season)

* The one that normalizes your mp3 files

What it does? This script runs mp3gain recursively for every .mp3 file contained into a specified directory.
Parameters are chosen by my tastes. I've found this good balance between volume and sound distortion risks.

External tools: mp3gain (version 1.4.6-r3 atm)
Script code

  1. find /media/whatever -iname "*.mp3" -exec mp3gain -d 4 -c -r {} +;  

Note: /media/whatever is the location of the directory containing audio files. It will be recursively analyzed and its files normalized. Furthermore you can substitute that "+;" with "\;". Doing this, mp3gain will execute once-per-file instead of collecting all filenames from infile parameter.

Update
After pointing out my attenction to the possibile 'wrong way' to normalize mp3 this way, I reminded that, a lot of time ago and on Windows, there were a GUI that helped me out so much in performing these tasks.
Googling a bit I ran into easyMP3Gain that provides a very nice GUI allowing you to check out very easily if the audio file is going to suffer by clipping once normalized with the selected gain value.
I really suggest you to give it a try!


last update: 2009-09-16 at 20:02