[PATCH] ReplayGain tags

Alex Merry kde at randomguy3.me.uk
Sun Jan 11 16:40:54 CET 2009


On Sunday 11 January 2009 15:04:53 Gregory Meyer wrote:
> On Sat, Jan 10, 2009 at 7:08 PM, Alex Merry <kde at randomguy3.me.uk> wrote:
> > * collectionscanner looks for REPLAYGAIN_ALBUM_GAIN and
> > REPLAYGAIN_TRACK_GAIN in Vorbis and FLAC files.  Note that MP3 and MP4
> > files have a global gain field that is interpreted by the MP3 or MP4
> > decoder, and so don't store this stuff in tags (they store the undo data
> > in the tags instead, which we don't care about).
>
> I'm don't think this is right.  There are multiple methods of applying
> replaygain to mp3 files and one is to do it exactly like vorbis does,
> store the values in the tags and then make the volume adjustment in
> software (foobar2000's replaygain scanner does this).  Actually, I
> think lame does this automatically now while encoding too.  mp3gain is
> the software that actually adjusts the mp3 data and stores the undo
> info in the tags.

Hmm... right.  I'll have to look into that.

Information on how replay gain information is stored is hard to come by.  The 
spec hasn't been updated for 7 years, and so is out of sync with what is 
actually done (and, in fact, has very little information about how the data 
should be stored).

The three most common tools for adding replaygain information to files are 
mp3gain, aacgain and vorbisgain.  aacgain is just mp3gain with MP4 support.  
aacgain and mp3gain set a value in the file itself ("global gain" in MP4, 
"scale factor" in MP3), which instructs the decoder to change the gain of the 
decoded output.  This is obviously completely reversible.  vorbisgain write 
tags, and the vorbisgain man page notes the tag names (REPLAYGAIN_TRACK_GAIN 
and REPLAYGAIN_ALBUM_GAIN), and leaves it up to the player to use them or not.

If you can tell me the tag names for the replay gain values for MP3 (and, 
ideally, MP4 files) when the data is stored in the tags, that would be 
immensely helpful (just what you see when you do, say, `id3v2 -l file.mp3` 
would do).

Alex



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090111/1aec596b/attachment.sig 


More information about the Amarok-devel mailing list