Gentoo Wiki


This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Apply replaygain to entire FLAC collection

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

% 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.

Retrieved from ""

Last modified: Fri, 05 Sep 2008 05:52:00 +0000 Hits: 3,628