jiixyj / loudness-scanner

A tool that scans your music files and tags them with loudness information.
MIT License
131 stars 23 forks source link

Silent tracks result in very high gain. #37

Open rkjnsn opened 5 years ago

rkjnsn commented 5 years ago

Some of my CD rips have silent tracks, which loudness-scanner tags with a gain of 51.00 dB. This isn't really a problem when applying the gain in software, since zero times any amount is still zero. However, when trying to use the gain value to adjust the amplifier volume directly, it doesn't work quite so well (turning the amp way up just to turn it all they way back down just a few seconds later).

It'd be nice if loudness scanner wrote a gain of 0 dB whenever all of the samples in a track are below a certain threshold. (Most of these tracks are pure silence, but one has a peak of 0.000061.)

jiixyj commented 5 years ago

Thanks for the report! This is an interesting use case. I agree it would make sense for silent tracks to have a gain of 0 dB. R128 has the concept of an "absolute threshold" at -70 LUFS. Everything below that is "silent" in the eyes of R128. We could use this as an indicator that we should write a gain of 0 dB.

I've been trying to be compatible with the ReplayGain feature of foobar2000, so I'll probably introduce this as a command line flag first.

zuzzurro commented 2 years ago

Was this resolved one way or the other?