Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Does applying ReplayGain to MP3 data change the samples or just the multipier? (Read 2977 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Does applying ReplayGain to MP3 data change the samples or just the multipier?

Does applying ReplayGain to MP3 data change the samples or just the multipier (like mp3gain does).
I have trouble with mp3gain not "levelling" my tracks auite even on some files.
So foobar2000 was recommended.
But some of my devices doesn't support the replaygain tags.
So with mp3gain I have written the changes to the mp3 data.
But mp3gain claims it does not change the sample data, only the multipiler, so there are no degradation.
Is the same true for the "apply replaygain to MP3 data" for foobar2000 (and does it to then have 1.5 dB steps)?
Lars-Erik Østerud

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #1
mp3gain only operates in steps of 1.5 dB anyway, same as foobar2000's ability to apply it directly to the MP3 data. This differs from AAC, where it can be applied directly. This is a limitation of the ability to directly alter the MP3 bitstream.

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #2
How do you make foobar2000 write data to the MP3 files the same way mp3gain does?
Without destroying the original samples. Or is the default way in foobar 2000 as well.
To bad you can't set the target dB in foobar, I have used 92 in mp3gain.
Recoding all files to 89 will be many files to change.
I though first I should compare the values between mp3gain and foobar2000.
But that's hard when foobar 2000 uses 89...
Lars-Erik Østerud

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #3
Right click, Apply Track (or Album) gain to file content does the same thing as MP3Gain, only it doesn't save undo information to tags as MP3Gain does, so it can't reverse the volume change.

"Preferences/ReplayGain Scanner/Alter file content" is where you can change the target volume (unless it's been moved in newer versions as I'm still using the last foobar2000 to support XP).

There's no reason for foobar2000's volume adjustment to be any different to that of MP3Gain, except that MP3Gain uses the original ReplayGain method for scanning files and determining the volume, whereas foobar2000 uses the newer EBU R128 method. It's arguably a little more accurate, so if you scan the MP3s again with foobar2000 you won't necessarily get the same result as with an MP3Gain scan, although generally they don't differ much. If foobar2000 adjusts the volume based on tags saved by MP3Gain though, the volume adjustment should be the same.

Keep in mind, MP3Gain saves the ReplayGain info to APE tags. Foobar2000 saves it to IDE3v2.3 tags by default. Foobar2000 will read the APE tags, but once you've scanned MP3s or adjusted the volume with foobar2000, it'll remove the info from the APE tags and save the new data to IDE3v2.3 tags. MP3Gain won't see the data in the IDE3 tags though, so if you load an MP3 into MP3Gain that's had ReplayGain info saved by foobar2000, it'll appear not to have been scanned. if you scan them again with MP3Gain, you'll have two lots of ReplayGain info saved to tags that won't necessarily be the same.

Also keep in mind, ReplayGain track/album gain is always saved relative to 89dB, even if you change the target volume. If you set the target volume to 92dB in MP3Gain, it'll show a tack/album gain of +3dB for MP3s that are already at 89dB. After the adjustment to 92dB, MP3Gain will show a track/album gain of 0dB in it's GUI, but the tags it saves will say -3dB because they're always relative to 89dB. Foobar2000 would display the track/album gain as -3dB after the volume is adjusted to 92dB.

If you want to see the ReplayGain info easily in foobar2000 after you've scanned and saved the ReplayGain data, similar to MP3Gain, you can create custom playlist columns. Right click on a column header and select Custom/More. The syntax is below.
ReplayGain's 89dB is based on a sound pressure level and therefore doesn't mean much to humans, but it equates to -18db on an audio meter. Therefore ReplayGain's 92dB equates to -15dB as it's 3dB louder.

Track Gain (relative to the ReplayGain target volume)
[%replaygain_track_gain%]

ReplayGain's Track Volume
$if(%replaygain_track_gain%,$puts(X,$sub(8900,$replace(%replaygain_track_gain%,.,)))$ifgreater($get(X),9999,$substr($get(X),1,3).$substr($get(X),4,5),$substr($get(X),1,2).$substr($get(X),3,4)) dB))

Track Volume (-18dB is equivalent to the ReplayGain target volume of 89dB)
$if(%replaygain_track_gain%,$puts(X,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$ifequal($get(X),0,0,$ifgreater($get(X),0,$replace(+$substr($num($get(X),4),1,2),+0,+),$replace($substr($num($get(X),5),1,3),-0,-))).$substr($num($get(X),5),4,5) dB)

Album Gain (relative to the ReplayGain target volume)
[%replaygain_album_gain%]

ReplayGain's Album Volume
$if(%replaygain_album_gain%,$puts(X,$sub(8900,$replace(%replaygain_album_gain%,.,)))$ifgreater($get(X),9999,$substr($get(X),1,3).$substr($get(X),4,5),$substr($get(X),1,2).$substr($get(X),3,4)) dB))

Album Volume (-18dB is equivalent to the ReplayGain target volume of 89dB)
$if(%replaygain_album_gain%,$puts(X,$sub(-1800,$replace(%replaygain_album_gain%,.,)))$ifequal($get(X),0,0,$ifgreater($get(X),0,$replace(+$substr($num($get(X),4),1,2),+0,+),$replace($substr($num($get(X),5),1,3),-0,-))).$substr($num($get(X),5),4,5) dB)

Track Peak
[%replaygain_track_peak_db%]

This is the sort of thing you'll see after creating custom Playlist columns using the above syntax, in this case after adjusting a bunch of MP3s to ReplayGain's 92dB (the nearest 1.5dB increment).

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #4
I think I found a way to compare my 92 dB mpgain files to the 89 dB scan of foobar2000.
If I do a rescan of the files with foobar2000 these things will be true:
More than -4.5 dB change:  Should be adjusted down one step (-1,5 dB gain) with mp3gain
-3.0 db (actually 4.4 to 1.4): No change (same result as mp3gain has set)
Less than -1.5 dB change: Should be adjusted up one step (+1,5 dB gain) with mp3gain.
If I scan with the "old" algorithm in foobar2000 then all is between -4,5 and -1,5 comfiming this.
If I scan with the new alorithm in foobar 2000 some bass heavy EDM music get higher than -4.5 and then I can adjust just those tracks down by -1,5 dB in mp3gain to get the right level.
Does this seems correct to you. Then I only have to adjust the few files that are to high.
Lars-Erik Østerud

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #5
The current version of the scanner supports both algorithms, though. The only difference is the gain detection, not how it applies it to files.

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #6
I think I found a way to compare my 92 dB mpgain files to the 89 dB scan of foobar2000.
If I do a rescan of the files with foobar2000 these things will be true:
More than -4.5 dB change:  Should be adjusted down one step (-1,5 dB gain) with mp3gain
-3.0 db (actually 4.4 to 1.4): No change (same result as mp3gain has set)
Less than -1.5 dB change: Should be adjusted up one step (+1,5 dB gain) with mp3gain.
If I scan with the "old" algorithm in foobar2000 then all is between -4,5 and -1,5 comfiming this.
If I scan with the new alorithm in foobar 2000 some bass heavy EDM music get higher than -4.5 and then I can adjust just those tracks down by -1,5 dB in mp3gain to get the right level.
Does this seems correct to you. Then I only have to adjust the few files that are to high.

Why can't use set the target volume to 92dB for foobar2000? For newer versions I think it's a pop-up menu when you adjust the volume. For older versions the setting is in preferences.

Be careful when using both MP3Gain and foobar2000, because if foobar2000 is saving the ReplayGain info to ID3 tags, MP3Gain won't read them. If it's writing ID3 tags, Foobar2000 will also remove any ReplayGain info from the APE tags after a scan or if you adjust the volume. MP3Gain will only read the ReplayGain info in APE tags and only write to APE tags.

As an example, if you have an MP3 at 89dB according to foobar2000, it'll write a Track Gain of 0dB to the tags. If you open that file with MP3Gain and scan it, MP3Gain will write -3dB to the APE tag after you adjust the volume to 92dB. The IDE3 tag will still contain the same TrackGain of 0dB, but it'll be wrong.

If the option isn't enabled, you can add "Apply custom gain to file content" to the ReplayGain right click menu. It'll allow you to adjust the volume up or down by a specified amount, so you don't need to do it with MP3Gain.

Given the current fb2k supports both scanning methods, you can set the target volume to whatever you like, and you can manually adjust the volume up or down, I'd stick to just using fb2k.

Re: Does applying ReplayGain to MP3 data change the samples or just the multipier?

Reply #7
I don't use the tags anyway as several of my devices don't support that.
So I use the "write to file" to change the block muliplier instead
(and in that dialog foobar2000 also supports changing the dB target).
For about 50% of the songs foobar2000 with R128 gets the same result as Mp3Gain with the old algorithm.
For the rest there are +/ 1.5dB. Donæt know whar is best yet, but R128 seems to handle bass heavy EMD music better).
Lars-Erik Østerud