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: difference in replaygain implementations for aac (Read 4571 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

difference in replaygain implementations for aac

Hi all,

I noticed that there is a difference between using replaygain on aac files when scanning with either foobar or aacgain and then applying it using aacgain.

I have several files which were scanned with foobar and several scanned with aacgain. (using the aacgain/mp3gain gui). After scanning all files, I applied the gain change using aacgain. (so that non-foobar players will also play the files using the correct gain.)

Recently I noticed that several files were just too silent...A quick check revealed that replaygain info was indeed present. I switched to track gain to make sure I was not just listening to quiet albums...

The problem did not go away. So I re-scanned the track gain using foobar. Sure enough, I got values of between +5/+9 depending on the file. when playing them back with this new gain setting they seem ok.

So, as I understand it replaygain is a fixed formula to calculate a gain offset to the original file and as such different implementations should never give different values...(especially as aacgain is based on mp3gain which lists in its documentation that its replaygain tags are compatible with foobar's...or was it the other way around?)

Any ideas as to why this is possible? And maybe how I can quickly find all badly-tagged files without re-scanning them all?

difference in replaygain implementations for aac

Reply #1
Sounds like the files have replaygain tags reflecting the *pre-aacgain* loudness.

You could just delete replaygain tags from those files and it should work.

difference in replaygain implementations for aac

Reply #2
Quote
Hi all,

I noticed that there is a difference between using replaygain on aac files when scanning with either foobar or aacgain and then applying it using aacgain.

I have several files which were scanned with foobar and several scanned with aacgain. (using the aacgain/mp3gain gui). After scanning all files, I applied the gain change using aacgain. (so that non-foobar players will also play the files using the correct gain.)

Recently I noticed that several files were just too silent...A quick check revealed that replaygain info was indeed present. I switched to track gain to make sure I was not just listening to quiet albums...

The problem did not go away. So I re-scanned the track gain using foobar. Sure enough, I got values of between +5/+9 depending on the file. when playing them back with this new gain setting they seem ok.

So, as I understand it replaygain is a fixed formula to calculate a gain offset to the original file and as such different implementations should never give different values...(especially as aacgain is based on mp3gain which lists in its documentation that its replaygain tags are compatible with foobar's...or was it the other way around?)

Any ideas as to why this is possible? And maybe how I can quickly find all badly-tagged files without re-scanning them all?
[a href="index.php?act=findpost&pid=304527"][{POST_SNAPBACK}][/a]


Replay gain gives you the loudness of a file relative to some reference value.  If you change the loudness of a file, the old values will then be incorrect.  If you rescan the files, the gain value will now reflect the new file's loudness.  In your case AACgain made the files quieter, so when you rescanned them, they now have positive offsets (meaning the files are quieter then reference).

If you're going to use AACgain and foobar, AACgain the files first and then replaygain them in foobar.  That way you'll be sure to have the correct gain value in foobar.

difference in replaygain implementations for aac

Reply #3
Quote
Replay gain gives you the loudness of a file relative to some reference value.  If you change the loudness of a file, the old values will then be incorrect.
[a href="index.php?act=findpost&pid=304686"][{POST_SNAPBACK}][/a]


That is how I understood it, but aacgain changes both the global gain for the file and adjusts the replaygain tags accordingly. Both programs' tags are compatible. (or they should be...)

eg: I have a file with a -7 track gain. this -7 comes from a replaygain scan using foobar. I then load the file in aacgaingui and use that to apply the -7 track gain. After I do this, most audio players play the file at a louder global gain. (as they should).
Foobar, however, will play it more silent. when examining tags with foobar, they are almost 0. When removing the track gain tag and re-scanning it I again get a value of around -7...

I have the impression that foobar does not use the global gain tag...

So Garf, my impression is that it's just the opposite of what you're saying...

difference in replaygain implementations for aac

Reply #4
Quote
I have the impression that foobar does not use the global gain tag...

So Garf, my impression is that it's just the opposite of what you're saying...
[a href="index.php?act=findpost&pid=304998"][{POST_SNAPBACK}][/a]


This is simply not possible. The global gain is not a "tag" but a value in the AAC bitstream, you cannot decode an AAC stream without interpreting it correctly.

Since you stated that other players (which most probably don't understand Replaygain tags) play it correctly and foobar plays it too silent, I stand by my statement that somehow the replaygain tags are still reflecting the old values.

Try "reload info from file" perhaps?

difference in replaygain implementations for aac

Reply #5
Not solved, but I think this is probably a foobar problem, so I will continue this discussion in the foobar forum.

difference in replaygain implementations for aac

Reply #6
I once got myself into a bit of a jam like this and the lesson I learned was: use either aacgain or foobar to apply gain, but never use both. This applies to mp3gain as well.

Having used foobar and mp3/aacgain a lot, I can say that I have never noticed any problem with how foobar plays back files that have had gain applied. So I don't think you will find an answer there. Garf has the answer. To fix the problem, I suggest you do one of the following:

1. Use AACgain to undo all replaygain changes to your files then start again. Hopefully you haven't deleted the undo tags.

2. Delete all tags and scan again using aacgain or foobar. You will lose the original undo tags if the files were scanned by aacgain originally, but that's not the end of the world.

One final point: Are you sure that foobar plays it too silently? The other players are ignoring the replaygain tags most likely, and just applying global gain. Foobar is applying global gain AND reading the replaygain tags. If the replaygain tags have negative values then foobar will play at a lower volume. But this may not be incorrect since global gain works in 1.5 dB increments, whereas the replaygain tags then fine tune the gain to set it to the value you wanted (e.g. 89dB). Sometimes this requires a negative gain in the tags.