CappielloAntonio / tempo

An open source and lightweight music client for Subsonic, designed and built natively for Android.
GNU General Public License v3.0
865 stars 39 forks source link

Fix negative replay gain values #187

Closed kmod-midori closed 3 months ago

kmod-midori commented 3 months ago

This regular expression converts -10.71 into 10.71 by ignoring -, making a track that is too loud even louder.

Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 3 min 11 s
Bit rate mode                            : Variable
Bit rate                                 : 3 417 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 96.0 kHz
Bit depth                                : 24 bits
Compression mode                         : Lossless
Replay gain                              : -10.71 dB
Replay gain peak                         : 0.785145
Stream size                              : 78.0 MiB (100%)
Writing library                          : Lavf58.76.100
MD5 of the unencoded content             : 144B59C4B27E5F30DC97A6385AD42156
CappielloAntonio commented 3 months ago

Hi @chengyuhui, thanks for the contribution. I have never had the opportunity to fully test the Reply Gain, partly because my library in most cases does not include the tag, partly due to the lack of better listening devices. What do you think about it? Does it work as you would expect?

kmod-midori commented 3 months ago

This implementation is actually buggy, as ExoPlayer actually does not accept positive gain (its volume only accepts 0.0~1.0, where 1.0 is the original sample), I have coded a replacement with AudioProcessor, but it is not finished yet. It works for my case though, as most of the times songs in my library are too loud instead of too quiet.

It mostly works (the reason why I wanted RG is a Japanese artist who publishes albums that are too loud for my ears even at 5% of my system volume, I manually tag each album with metaflac --add-replay-gain *.flac) the same way as other software that implements RG. It is quieter and actually no longer hurt my ears, but I can't comment on the quality cuz I have no idea.