DarwinAwardWinner / rganalysis

A script for adding replaygain tags to music files
31 stars 4 forks source link

analysis backends #6

Closed meeotch closed 7 years ago

meeotch commented 7 years ago

The mp3gain page says: "MP3Gain does not just do peak normalization, as many normalizers do. Instead, it does some statistical analysis to determine how loud the file actually sounds to the human ear."

My question is, do either of audiotools | bs1770gain operate in this way? Also, was support for mp3gain left out for a particular reason?

DarwinAwardWinner commented 7 years ago

Yes, the essence of the ReplayGain algorithm is to normalize the perceived loudness of a file. Any implementation of the algorithm works this way. I didn't implement an MP3Gain backend because it only supports MP3 files, while the other backends that I've implemented support a wide variety of file formats. Nothing stops you from implementing an MP3Gain backend whose supports_file method returns False for everything except MP3 files. However, doing so would provide little benefit, since the existing backends already support MP3.

meeotch commented 7 years ago

Thanks for the info & quick reply. So are there any differences between the two existing backends that you're aware of?

DarwinAwardWinner commented 7 years ago

ReplayGain is a specified algorithm. Any implementation should give exactly the same result, unless it has a bug. The only practical difference is which file formats each backend supports, and how easy it is to install.

karolzlot commented 5 years ago

I confirm that two available backends give different results:

# audiotools bs1770gain
01 K.flac -5.92 dB -3.23 dB
02 S.flac (was loudest of three) -8.70 dB -8.86 dB
03 C.flac -2.31 dB -1.97 dB
album (many files) -7.12 dB -5.52 dB

for me audiotools gain was not enought, too small normalization of volume,

DarwinAwardWinner commented 5 years ago

Well, I don't know the specifics of the two implementations. Perhaps they use slightly different methods to calculate the loudness? You can try running bs1770gain manually with different options to see if any of them match up with audiotools' implementation. I'm not sure what options audiotools has.