Difference between Mp3gain and Replaygain
Difference between Mp3gain and Replaygain
Jul 30 2004, 15:46
Joined: 16-June 04
Member No.: 14715
Replaygain and MP3Gain
I was confused about the differences between Replaygain and MP3Gain, so wrote this note explaining the difference. I hope this is the correct forum, please move it if it would be better somewhere else.
I realise that the FAQ has a section "Replaygain: WaveGain vs. MP3Gain" but that doesn't obviously cover the features I describe below.
I illustrate the difference by describing adjustment of playback volume using MP3Gain and Foobar2000 (a Replaygain-aware MP3 player). I'm assuming the reader is familiar with the priciples behind Replaygain.
An MP3 file is composed of many blocks of audio, one after the other. Each block corresponds to a few milliseconds of music. Each block has a global gain field which tells an MP3 file player how loud to play that block. In addition to these global gain fields, each MP3 file can also have a Replaygain header which applies to the whole file, and which tells a Replaygain-aware MP3 player how loud to play that file.
MP3Gain determines the Replaygain values for the MP3 file. MP3Gain then writes to the global gain header of every block, adjusting them all up or down by the same amount in order to achieve those Replaygain values. MP3Gain also writes a Replaygain header which applies to the whole MP3 file. Since MP3Gain has adjusted the global gain field for each block to give the right volume, the volume adjustments in that Replaygain header will be small. This MP3 file will then play at the right volume in all players, whether or not they are Replaygain-aware.
Foobar2000 doesn't write to the global gain field of individual blocks. It determines and writes only the Replaygain header which applies to the whole MP3 file. The value it writes to the Replaygain header will therefore be different to that written by MP3Gain since each block is left with it's original global gain field setting.
It is potentially easy to screw this up.
For example, let's say we have a file which is VERY LOUD. We use Foobar2000 to adjust the Replaygain header, which of course writes a value which tells a Replaygain-aware player to turn everything down a lot.
Now suppose we use MP3Gain to adjust the playback volume. And suppose that this time MP3Gain is set to IGNORE tags in the file (i.e. "Options" > "Tags" > "Ignore (do not read or write tags)" is checked). It will still adjust the global gain field of each block (and turn them all down), but it will ignore the Replaygain header, i.e. leave it at the setting which Foobar2000 used.
If we then play our MP3 file in a player which is NOT Replaygain-aware, everything will be fine - the MP3 file will play at the right volume because the global gain field for each individual block has been turned down.
BUT what happens if we then play the MP3 file in an Replaygain-aware player? Now the file will be played much too quietly because the global gain field settings for each block have been turned down AND the Replaygain header for the whole MP3 file is still telling the player to turn down the whole file.
The safest solution to all this is to make sure that if you use MP3Gain on your files, it is NOT set to ignore tags in the file. Then it won't matter which you use to adjust the Replaygain (Foobar2000 or MP3Gain, in any order) since either will set the value of Replaygain correctly.
Edit: Correction. Since I wrote the above paragraph I have got to know foobar2000 better.
There are several different types of headers (usually called "tags") which hold information about an MP3 file - two of the most common are ID3 and APE. Most MP3 taggers and CD rippers use ID3 tags to hold artist information. MP3Gain uses APE tags to hold MP3Gain and Replaygain information.
Because foobar2000 ignores ID3 tags if it finds an APE tag, it is better NOT to let MP3Gain add tags to MP3 files if you intend to use foobar2000 as your MP3 player. If you do let MP3Gain write tags, you will find that foobar2000 will not display Artist/Album/Track etc correctly unless that information is also in the APE tag. Since most MP3 taggers use the ID3 tags to store that information, it will almost certainly not be displayed.
You will lose very little by not letting MP3Gain write tags - each individual block of music has had it's global gain header adjusted so it will always play correctly to within 1.5dB (MP3Gain's accuracy). To set MP3Gain to not write tags to the file make sure "Options" > "Tags" > "Ignore (do not read or write tags)" is NOT checked. MP3Gain can also remove tags which it has previously added. If you want the ReplayGain correction to be exact, you can use foobar2000 to adjust the ReplayGain. foobar2000 can be configured to write ReplayGain values to ID3 tags so any previously-stored Artist/Album/Track information is not lost.
The above correction may not apply to players other than foobar2000.
Note that the advantage of using MP3Gain is that the global gain header for each block MUST be supported by all MP3 players, hardware or software. The Replaygain header is not supported by all players.
This post has been edited by Pootle_1: Aug 23 2004, 20:48
Sep 3 2004, 23:41
Group: Developer (Donating)
Joined: 28-June 02
Member No.: 2425
i still have some doubts ...
on mp3gain, to what tags it refers on Options/Tags? Glogal (mp3gain) or Frame?
"Options" > "Tags" > "Ignore (do not read or write tags)"
would make mp3gain ignore foobar's correction, which is the oposite we want
"Options" > "Tags" > "Recalculate (do not read tags)"
would make mp3gain recalculate the global tag, after computing the frame ones, which we would like
"Options" > "Tags" > "Don't check while adding files"
it would do as if the file has never been gained, either glogally, or by frame?
i allways used MP3gain, and have no problem with foobar reading my tags ... so i don't get this also.
and what should i do, if i want to apply mp3gain to my files, and play them throug fb2k (but not use fb2k gain calculus)?
|Lo-Fi Version||Time is now: 6th March 2015 - 23:09|