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: aacgain - Tags and Values (Read 2995 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

aacgain - Tags and Values

Hi,

I would like to have a "Apply ReplayGain to MP4 Data" option in foobar, analogue to "Apply ReplayGain to MP3 Data" which is already there. As this option does not seem to exist at the moment, I am trying to create it by myself, using aacgain as an external application. However, I have two question regarding aacgain's operation. Let's start with an example:

AAC-File, ReplayGain info added by foobar:
Code: [Select]
Atom "----" [replaygain_album_gain] contains: -7.32 dB
Atom "----" [replaygain_album_peak] contains: 1.124630
Atom "----" [replaygain_track_gain] contains: -6.76 dB
Atom "----" [replaygain_track_peak] contains: 1.075577


After running aacgain for an analysis:
Code: [Select]
C:\aacgain\test\test.m4a
Recommended "Track" dB change: -6.760000
Recommended "Track" mp3 gain change: -4
Max PCM sample at current gain: 35244.492188
Max mp3 global gain field: 182
Min mp3 global gain field: 99


Recommended "Album" dB change for all files: -7.320000
Recommended "Album" mp3 gain change for all files: -5


The relevant tags look like this:
Code: [Select]
Atom "----" [replaygain_album_gain] contains: -7.32
Atom "----" [replaygain_album_peak] contains: 1.12
Atom "----" [replaygain_track_gain] contains: -6.76
Atom "----" [replaygain_track_peak] contains: 1.08
Atom "----" [replaygain_track_minmax] contains: 99,182


And after applying a gain change of -7 to the file:
Code: [Select]
Atom "----" [replaygain_album_gain] contains: 3.21
Atom "----" [replaygain_album_peak] contains: 0.33
Atom "----" [replaygain_track_gain] contains: 3.78
Atom "----" [replaygain_track_peak] contains: 0.32
Atom "----" [replaygain_track_minmax] contains: 92,175
Atom "----" [replaygain_undo] contains: 7,7


So my questions are:

1) Is the only difference between foobar's and aacgain's tags that foobar puts "dB" into the tag and uses more digits? Could I therefore just strip the "dB" and some digits from foobar's tags to make aacgain use them? "com.apple.iTunes" as mentioned in this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=55934) does not seem to be added by aacgain anymore.

2) What does the gain value stand for? I cannot find the value of 7, neither directly nor in a dB-ized form in either gain or peak tag changes.gain went from -7.32 to +3.21 (+10.53), peak went from 1.08 to 0.32 (1/3.38). 10^(10.53/20)=3.36. So this fits, but where is the 7?

Thanks for your help.

rumpel

aacgain - Tags and Values

Reply #1
Quote
So this fits, but where is the 7?

7 * 1.50515 dB = 10.53605 dB.

1.50515 = 1/4 * 20*lg(2) - the smallest possible step of volume adjustment for mp3 files (and, probably, AAC - I just don't know).

 

aacgain - Tags and Values

Reply #2
1.50515 = 1/4 * 20*lg(2) - the smallest possible step of volume adjustment for mp3 files (and, probably, AAC - I just don't know).

Thanks, that answers question 2 and also explains the difference between "Recommended dB change" and "Recommended mp3 gain" in aacgain's output.