Running mp3gain recursively in album mode

am 27. September 2009, 10:33 in Software, Tags: , ,

If you are running linux and want to assign replay gain values to your mp3s recursively, you are currently out of luck since mp3gain does not yet have a recursive mode. The simple solution

find /path/to/mp3s -iname "*.mp3" -exec mp3gain -r -k -p {} \;

only works if you want to have radio gain mode, i.e. all mp3s are brought to uniform common volume.

But if you are like me and you would like to listen to whole albums at a time, the -a switch is your friend and the above solution does no longer work. I have written two small python scripts which do this, assuming your mp3s are sorted either like this:

artist/single_song.mp3
artist/album/song.mp3

Then you can use calculate_gain_all_in_one_folder.py. If instead your artists are grouped by initials like so:

initial/artist/single_song.mp3
initial/artist/album/song.mp3

then use calculate_gain_for_initial_folders.py. Both scripts do the right thing, i.e. apply album gain to albums and radio gain to single songs. They are not exactly userfriendly, but you should manage. Both scripts are released under the GPL.

By the way, vorbisgain has a recursive mode which works (almost) perfectly (only almost, since it of course does not known when to apply album and when to apply radio gain).


2 Kommentare zu “Running mp3gain recursively in album mode”

  1. MarioKlar schreibt am 14. April 2010, 22:27:

    Auch wenn die Frage etwas offtopic ist, wo bekomme ich fuer meinen Blog das Theme her? Gibt es das irgentwo zu downloaden? Sieht sehr Schick aus!

  2. Jan schreibt am 15. April 2010, 10:53:

    Ich muss an dieser Stelle mal klarstellen, dass ich prinzipiell gerne den Code für mein Blog hergebe. Allerdings würde ich mich dann über einen Link und über eine Erwähnung freuen.
    Im Fall dieses Kommentars bin ich aber recht skeptisch, schließlich bekam ich denselben Kommentar innerhalb von 15 Minuten zweimal von derselben IP, allerdings unter zwei verschiedenen Namen, zwei verschiedenen Email-Adressen und mit zwei verschiedenen Webseiten (gleiches Layout, aber vollständig verschiedener Inhalt), die ich aufgrund von Spam-Verdacht mal entfernt habe.
    Also: Ernsthaften Fragen bin ich durchaus nicht abgeneigt, in diesem Fall zweifle ich den Ernst aber an. Ich lasse mich natürlich gerne eines Besseren belehren.


Schreibe einen Kommentar

Wo ist der Inhalt?