Help - Search - Members - Calendar
Full Version: Replaygain (ogg vs mp3)
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
krsna77
Ok, silly question.

I encoded an album in ogg, and then encoded it again in mp3.

I then used the respective replaygain tools, and applied album gain to both albums.

Thing is, the gain was applied, but the mp3 set sounds consistently louder than the ogg set. Does mp3gain have a louder default setting ("89dB") than the ogg replaygain utility's default setting?

Just curious.
ff123
I have mixed oggs and mp3's and the oggs seem to sound softer to me as well. It should be an easy thing to test how much difference there is -- although I haven't done it.

ff123
john33
Just to be a bit different, I've produced a version of replaygain that I've called WaveGain, for want of a better name, that applies the ReplayGain algorithms to the original wave file. I haven't looked at the MP3 version, but Garf's ogg version, and I imagine they must be the same, converts the ogg files to waves, and then inputs the waves to the replaygain algorithms. So, I thought, why not apply it first, then it will be the same in whatever format it is subsequently encoded. It works in Audiophile/Album and Radio/Single Track modes with wildcard filename input.

Anybody interested? I'll post it on Roberto's site when he's back from vacation.

john33 biggrin.gif
krsna77
Just to clarify - it's not a problem for me, as I don't mix different formats in any single album collection - I was just curious.

As to WAV replaygain - it sounds like a utility I might use sometimes, but ultimately it lacks the benefit of applying gain values to the encoded file - that it can be altered / undone at any time in the future (plus the fact that I have the option to listen to encoded songs in /either/ radio or audiophile mode). Or do I have the wrong idea? ;)

Not to belittle your work - again, I could probably find uses for it. :)
Snelg
QUOTE
Originally posted by john33
Just to be a bit different, I've produced a version of replaygain that I've called WaveGain, for want of a better name, that applies the ReplayGain algorithms to the original wave file.


Groovy. I whipped up a quick-n-dirty program named "WavGain" when I did the first C implementation of the Replay Gain algorithms for David. My program, though, doesn't handle wildcards, and it only analyzes .wav files and spits out the results. It does not go back and apply any changes. At the time I didn't want to deal with clipping issues, and I was more interested in implementing the mp3 version.

So your program sounds quite superior smile.gif

QUOTE
I haven't looked at the MP3 version, but Garf's ogg version, and I imagine they must be the same, converts the ogg files to waves, and then inputs the waves to the replaygain algorithms.


Yup. That's how mp3gain calculates the suggested Replay Gain values. What it does with those values (apply them directly to the mp3) is different from what the ogg version does (store the values in a special field), but I think everyone's already clear on that point...


As for the original question about volume difference between ogg replaygain and mp3gain, it's quite likely that the ogg version uses 83 dB as specified by the Replay Gain proposal. Because mp3gain modifies the mp3 file directly, I bumped the default up to 89 dB. That stopped numerous newbie "It's making my mp3s too quiet for my portable!" complaints.
YinYang
QUOTE
Originally posted by Snelg

As for the original question about volume difference between ogg replaygain and mp3gain, it's quite likely that the ogg version uses 83 dB as specified by the Replay Gain proposal. Because mp3gain modifies the mp3 file directly, I bumped the default up to 89 dB. That stopped numerous newbie "It's making my mp3s too quiet for my portable!" complaints.


Nope. It ain't that. Garf's ogg-replaygain also uses 89 dB it seems. I checked with Matthijs Laan's ReplaygainDSPplugin for Winamp. It calculates the replaygain needed for the input signal, which is in total agreement with title-based oggs. It reports a gain of close to 0.00dB for those.

So I tried with mp3. A file was run through MP3Gain radiogained to a volume at 88.3 dB

When played through Winamp, the DSP-plugin calculated a needed gain of +0.71 dB

So I guess the difference some notice must be because of the 0.75 dB margin to either side or a placebo effect smile.gif
Snelg
QUOTE
Originally posted by YinYang
Nope. It ain't that. Garf's ogg-replaygain also uses 89 dB it seems. I checked with Matthijs Laan's ReplaygainDSPplugin for Winamp. It calculates the replaygain needed for the input signal, which is in total agreement with title-based oggs. It reports a gain of close to 0.00dB for those.


Good to know. Makes sense that they agree down to nearly 0.00 dB, since the ogg-replaygain stores the precise recommended dB change.

QUOTE
So I tried with mp3. A file was run through MP3Gain radiogained to a volume at 88.3 dB

When played through Winamp, the DSP-plugin calculated a needed gain of +0.71 dB


Again, makes sense. The method I use to losslessly change the volume of an mp3 can only change in increments of 1.5dB, so the final volume can be as much as +/- 0.75 dB off from the precise recommended volume.
ff123
Well, I did my comparison, and I seem to be doing something wrong. I encoded to both mp3 and ogg, used mp3gain and replaygain, respectively, decoded to wav, and looked at the waveforms in CoolEdit. The ogg appears not to have had its gain amplified, whereas the mp3 file's gain was.

The ogg tag reads:

RG_PEAK=0.526
RG_RADIO=+6.91 dB

I'm using the Nullsoft Vorbis Decoder v1.17b, with the "Use Replay Gain" box checked and set to Radio / Track. Also the Clipping Prevention box is checked.

Investigating further..

ff123
ff123
Ok, replaygain for ogg / ogg decoder does work, in the other direction, i.e., for reducing gain. I just tried it on applaud.wav, and both mp3gain and replaygain produced about the same amplitude file.

But files are not amplified when playing back through the ogg decoder. Is this a known limitation?

ff123
Garf
QUOTE
Originally posted by ff123
But files are not amplified when playing back through the ogg decoder.  Is this a known limitation?


Try disabling clipping prevention (and enable the hard limiter)

--
GCP
ff123
QUOTE
Try disabling clipping prevention (and enable the hard limiter)


I tried it with 1.17g this time, and with your suggestions. Preamp is set to 0. Same thing, gain is reduced on files which need it, but not amplified on the others.

ff123
Lear
QUOTE
Originally posted by Snelg


As for the original question about volume difference between ogg replaygain and mp3gain, it's quite likely that the ogg version uses 83 dB as specified by the Replay Gain proposal. Because mp3gain modifies the mp3 file directly, I bumped the default up to 89 dB. That stopped numerous newbie "It's making my mp3s too quiet for my portable!" complaints.


The ogg version uses the C routines you wrote (version 1.0 I think), where PINK_REF is 64.85. Don't know if that means 83 or 89 dB though. smile.gif
YinYang
QUOTE
Originally posted by ff123


I tried it with 1.17g this time, and with your suggestions.  Preamp is set to 0.  Same thing, gain is reduced on files which need it, but not amplified on the others.

ff123


1.17e here. Same results. Gain that needs amplification is not applied, but reduced gain is.

Edit: This seems to be regardless whether clipping prevention or hard limiting is applied or not
Speek
The latest version of WaveGain + a frontend can be found here: http://home.wanadoo.nl/~w.speek/wavegain.htm
Peter
everything seems to work fine for me, can you give me any sample files ?
[edit] funny shit, looks like the problem doesn't occur in debug build, hacking in progress...
[edit2] fixed. btw, next time use email rather than send PMs, i get them much quicker.
ff123
Thanks, Peter! Works great now.

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