Help - Search - Members - Calendar
Full Version: Replaygain MP3 - different results with Foobar and Metamp3 (via REACT2
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
gsa999
I have encoded the same album at 320 kbps and run replaygain to produce both album and track metadata.

However, using Foobar I get the following results:

Album Gain: -10.10
Album Peak: 1.1653722
Track 11 Gain: -8.76
Track 11 Peak: 1.065687

Using metamp3 via REACT2 I get the following results:

Album Gain: -10.08
Album Peak: 1.136797
Track 11 Gain: -8.74
Track 11 Peak: 1.025564

The gain information is very similar but not exactly the same. However the album and track peak information is different. I am seeing this for all the tracks on the album, but have just quoted the data for track 11 above. I don't understand the technicalities of RG, but I want to be sure I am putting the most accurate RG information onto my MP3 files.

Can anyone explain to me why I am getting different results using these two methods and which one they think is likely to be the most accurate.

Thanks
Akkurat
I guess that the tools have implemented the ReplayGain calculation algorithm slightly differently.

I thought that you were (more) interested about the big peak value differences between lossy and lossless formats.
In example:

FLAC:

Track gain: -9.32 dB
Track peak: 0.99932861
Album gain: -8.58 dB
Album peak: 0.99938965

Mp3:

Track gain: -9.350000 dB
Track peak: 1.213544
Album gain: -8.570000
Album peak: 1.351607

Why the peak values are totally different? Is this normal?

And by the way, shouldn't there be a "dB" at the end of the album gain in Mp3's? Is it required?
MuncherOfSpleens
QUOTE (Akkurat @ Aug 3 2008, 08:49) *
Why the peak values are totally different? Is this normal?

To my understanding, it has to do with lossy formats’ use of floating-point numbers.

The original data, presumably from a CD, uses integer samples. Each sample can only hold a value in a very strict range (for 16-bit signed integers, from -32,768 to 32,767). Lossless formats preserve this information exactly, so the peak never goes outside of these boundaries, and thus can only go up to 1.0.

Lossy formats don’t care about preserving the original data perfectly, and their floating-point nature allows them to go outside of the “boundaries.” So they do.

Yes, it’s perfectly normal.
Dynamic
The peak data should be the same if the same file is scanned by two bits of software.

However, it sounds like you ripped the CD twice and encoded each, possibly with slightly different settings or a different encoder.

Therefore the two 320 kbps MP3 files differ slightly. There may be a small timing offset between EAC and fb2k (read offset correction) but you used the exact same encoder and settings. There may have been a read-error in the CD extraction. The encoders used may have been different (even two versions of LAME) or have different settings passed to them.

Any of these, or a combination could cause the peaks to differ between the two files. You could rescan the file created by REACT in fb2k to see if the peak value comes out the same.

The track gain and album gain figures are close enough to be inaudibly different and you shouldn't worry.
bilbo
Other than for informational purposes, Does the peak value have any function for the playback?
j7n
The peak value is there to find out if and by how much audio will clip during playback, either because of lossy encoding, or positive ReplayGain adjustment.
Dynamic
QUOTE (bilbo @ Aug 4 2008, 16:35) *
Other than for informational purposes, Does the peak value have any function for the playback?


Yes. It allows the player to "prevent clipping according to peak value".

For example, 16-bit audio is limited to +32767 and -32768 sample values. Imagine a classical piece of music which comes out at 82.98 dB SPL. It will have a Replay Gain value of +6.02 dB to bring it up to 89.00 dB. If it had a peak (e.g. a crescendo, a cannon shot or something else) of +28000 or -28000, the +6.02 dB gain would raise the peak to +56000 or -56000, which can't be represented in 16-bit integers, so the peaks would be flattened (clipped) to +32767 and -32768, possibly for more than one sample, which might, or might not be audible. If a limiter is used, the peaks would be more softly distorted so that they couldn't exceed full scale, but that distortion might still be audible.

Clipping prevention will limit the applied gain such that the peaks can only reach +32767, so the actual gain ratio applied would be 32767/28000 = 1.17025. In decibels, that's 20 log 1.17025 = +1.37 dB, so the playback volume will actually be 84.35 dB, which is 4.65 dB lower than the target of 89.00 dB.

Having the occasional variation in volume may be preferable to hearing clipping. However, I tend to use fb2k's advanced limiter to soften those rare peaks when clipping would have occurred in Album Gain mode (without clipping prevention) but otherwise leave non-clipping audio alone.
greynol
QUOTE (j7n @ Aug 4 2008, 09:55) *
The peak value is there to find out if and by how much audio will clip during playback, either because of lossy encoding, or positive ReplayGain adjustment.
It is not possible to determine "by how much". It could be that it's killing one really big peak and it's possible that it won't even be audible. Me thinks you've overstepped your explanation a bit. wink.gif
gsa999
QUOTE (Dynamic @ Aug 3 2008, 19:17) *
Any of these, or a combination could cause the peaks to differ between the two files. You could rescan the file created by REACT in fb2k to see if the peak value comes out the same.
OK I finally got back to this. I cleared the RG tags generated from the REACT2.metamp3 files and ran the album through Foobar RG. The results were:

Album Gain: -10.10
Album Peak: 1.136832
Track 11 Gain: -8.76
Track 11 Peak: 1.025595

The gains are exactly the same as the files that were not encoded via REACT (ie EAC + Lame external encoder), but the peaks are different but are very close to the peaks I got from metamp3 via REACT.

The encoding options were exactly the same -b 320. I don't understand why the files that were encoded through normal EAC + Lame are giving me different peak values to when I encode via REACT2 using Lame.

So to summarise:
When I rip and encode via normal EAC + Lame with command line option -b 320 %s %d I get peaks of 1.163722 (album) and 1.065687 (track) and when I encode same album via EAC/REACT2/Metamp3 with -b 320 option I get peaks of 1.136797 (album) and 1.025564 (track).
Dynamic
QUOTE (gsa999 @ Aug 5 2008, 21:37) *
So to summarise:
When I rip and encode via normal EAC + Lame with command line option -b 320 %s %d I get peaks of 1.163722 (album) and 1.065687 (track) and when I encode same album via EAC/REACT2/Metamp3 with -b 320 option I get peaks of 1.136797 (album) and 1.025564 (track).


Have you checked the two files in fb2k, right click, Properties. Is the same version of LAME used in both?

If so, check the rips. Rip to lossless (e.g. WAV) and use fb2k's bit compare two tracks to see if there are ripping errors.
Akkurat
QUOTE (Akkurat @ Aug 3 2008, 15:49) *
FLAC:

Track gain: -9.32 dB
Track peak: 0.99932861
Album gain: -8.58 dB
Album peak: 0.99938965

Mp3:

Track gain: -9.350000 dB
Track peak: 1.213544
Album gain: -8.570000
Album peak: 1.351607
...
And by the way, shouldn't there be a "dB" at the end of the album gain in Mp3's? Is it required?

Bump. Is the "dB" required?
Dynamic
QUOTE (Akkurat @ Aug 13 2008, 12:16) *
Bump. Is the "dB" required?


I've looked at an mp3 of mine in Notepad text editor, and it's explicitly there in Track Gain but not in Album Gain and AFAIK it works for me (carriage returns added for legibility):

CODE

ID3 }TPE1  Scissor SistersTALB Ta-Dah (with Bonus Track)TRCK
 3/13TIT2  I Can't DecideTYER  2006TENC @ userTSSE 0 useLAME 3.97 -V2 --vbr-new --noreplaygain --nohistTCON
(17)RockCOMM ( XXX Created with EAC/REACT2, 2007-06-03COMM
. XXXID3v1 Comment Created with EAC/REACT2, 200TXXX
 mp3gain_minmax 137,249TXXX
mp3gain_album_minmax 135,249TXXX
mp3gain_undo +006,+006,NTXXX
# replaygain_track_gain -0.530000 dBTXXX  replaygain_track_peak 0.400910TXXX
replaygain_album_gain -0.670000TXXX  replaygain_album_peak 0.438842
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.