metamp3 - command line tool
Reply #78 – 2007-04-22 23:21:29
In addition to the features already available, I'd like to add it to automatically write SoundCheck tag values for the iPod, when it computes and writes replaygain id3tags. A useful link is here, but I must know exactly how to convert the replaygain value to a SoundCheck value in order to do that. Also, take a look at this page. Towards the bottom you will find some perl code which converts a replaygain volume adjustment (i.e. a signed number of dB) into the hexadecimal values found in the iTunNORM tag. The formula for converting replaygain adjustment to a soundcheck adjustment in iTunNORM is:sc = pow(10, -rg/10) * base, where: rg = replaygain adjustment, in +/- dB base = 1000 for the 1st and 2nd numbers in iTunNORM tag, and 2500 for the 3rd and 4th numbers in iTunNORM tag sc = value of the 1st 4 numbers in iTunNORM using the above base. I did some experiments that indicate this is correct: 1) I manually set 1st 4 hex numbers in iTunNORM tag using the above formula and verified that iTunes's Get Info command shows the same dB adjustment. 2) I used MP3Gain to alter the volume of a track, removed its iTunNORM tag, reimported it into iTunes to generate a new iTunNORM tag, and used the inverse of the above formularg = -10 * log10(sc/base) to verify that 1st 4 numbers of iTunNORM tag changed by the same amount as the MP3Gain adjustment. Hope that helps... Dave