nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
11.93k stars 1.03k forks source link

[feature request] Add support for ReplayGain (track-level loudness normalization) #703

Open Venryx opened 4 years ago

Venryx commented 4 years ago

It would be nice if Nuclear had built-in support for adjusting the loudness of tracks based on ReplayGain metadata stored within media files.

For those new to it, ReplayGain is a standard by which tracks can be scanned by software that detects how "loud" each track is. That software then "tags" the track file with data saying how loud it is. Music players can then use that data to "normalize" the volume of each track played, so that you don't have jarring volume changes between tracks.

I've been using this feature for years in other players (foobar2000, Clementine, and VLC), and it's something I miss in Nuclear. (I get by for now by prepping to shift volume near track changes ^_^)

P.S. It would also be nice at some point if Nuclear could be used as a ReplayGain scanner, ie. applying the ReplayGain tags itself (for example, after track downloads). This is a longer-term task though; much more important to just get reading/using of the tags working for now.

nukeop commented 4 years ago

We discussed normalizing audio previously here: https://github.com/nukeop/nuclear/issues/329

I wasn't aware of ReplayGain then, and I had no idea how to approach this. Would you rather use ReplayGain or stream through ffmpeg-normalize?

Venryx commented 4 years ago

My own preference is to use ReplayGain, since it seems to be the "de-facto standard" for track loudness normalization in sound players. (check out the list of supporting players on the Wikipedia page)

I'll probably look into adding support for this in a few weeks, in two stages: 1) Add support for reading ReplayGain metadata, and adjusting the track's (internal) playback volume accordingly. 2) Add support for streamlined "scanning" of tracks to calculate the ReplayGain metadata. (probably with a setting to automatically apply this scanning on track download and/or inclusion within local-library)

nukeop commented 4 years ago

Nice, that sounds good. Thanks for coming up with this.