TIP Applying replaygain to entire FLAC collection

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

[edit] Apply replaygain to entire FLAC collection

Here, I treat my entire FLAC music collection as one "virtual" album, and apply replay gain accordingly.

  • cd to the root of your flac files
    • in this example, the directory would be "/home/music/originals"
  • apply replaygain:
% cd /home/music
% find originals -name "*.flac" -type f -print0 | xargs -0 metaflac --preserve-modtime --add-replay-gain

If you have many files, with potentially long file names, metaflac may not get them all on the commandline at once (xargs limits itself to about 128KB by default). One way to get around this is to create another directory with simple numbered hard links to each of your flac files, and run metaflac there.

This takes a while, so do it in a "screen" session...and wait.

Once it's done, check any of your flac files with

% metaflac --list my_song.flac

and see the replaygain values.

Personal tools