ReplayGain would greatly help in normalising the audio levels when playing songs from a radio. Quite often a loud track will transition to a track with relatively low audio levels, and vice versa.
Some Subsonic players have support for ReplayGain, by downloading a file completely and then extracting the required meta data. This becomes a problem however in the web UI, as it only has the audio stream and the meta data provided by the API. Adding ReplayGain to the API per track, similarly to things like licensing information or track title could solve the problem I think.
This could also help when transcoding into formats that don't have official support for ReplayGain.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Thank you for the suggestion. To implement that would likely have to store the information with uploads (possibly parsing the replay gain tag from the file metadata), assuming a default replay gain for existing files (or files without the tag), and tweak our audio player to leverage this information. I expect the audio player part to be the most complex.
The most common tags which i know:
REPLAYGAIN_ALBUM_GAIN, -11.66 dB
REPLAYGAIN_ALBUM_PEAK, 1.000000
REPLAYGAIN_TRACK_GAIN, -12.20 dB
REPLAYGAIN_TRACK_PEAK, 0.997192
These are recognized by my cars audio system / foobar / etc., at least the Track_gain i suppose.
It would be something like:
level = (1 + Math.min(Math.pow(10, (GAIN / 20)), (1 / PEAK)))
would work for album OR track gain
When you've got some older tracks this get's more important since newer songs are all near the maximum volume
I'd consider splitting track and album gain into two requests or tasks. Since album gain could get fairly complex.
I say this because ideally the player should be aware of the context in which the user is playing an album, in which case the album gain should be used. That is, if the album gain is available, if not then it would fallback to track gain.
However, if the tracks are mixed with tracks from other albums, i.e. in the queue or the radio then the track gain should be used. Supporting album gain is especially important when listening to gapless albums (#739 (closed)).
There are obviously various methods of using gain but I believe this is the most standard scenario.
I am not sure how much of the context awareness is already possible but achieving just track gain to maintain a constant volume in radios etc. would be a good start in my view.
As far as we are not calculating replay gain, just reading and applying it - it's not true.
I read somewhere (I can't find source atm) that album gain should be used when possible, even when not playing in album context. Tidal in their API also provides only one gain value and afaik it's album gain, not track gain.
Tbh. I'd split it to 2 issues.
One would be about backend change to support some kind of ReplayGain API and reading ReplayGain tags from files.
Second would be do add actual support for ReplayGain to webUI.
Probably some third party clients would benefit from this and tbh it's good way to make sure newly imported files have tags imported to funkwhale db.
For the record, I know a particular album ("Summvs" by Alva Noto + Ryuichi Sakamoto, but this could apply to other similar albums) that has a final track that is very quiet but is not silence.
After ReplayGain analysis, this has the result of making album gain into shooting the rest of the album way loud, to unpractical levels where it clips heavily and ears hurt.
If you're gonna use album gain, please put a sensible limit on the minimum and maximum gain. Thank you.
EDIT: On more technical terms, I assume some kind of comparison will have to be made between both track and album gain tags to this effect. Only track gain can be used to determine how loud each individual track is, in order to implement some sort of protection against overshooting.
I bring this up because an end user who didn't upload a track will have no way of fixing this manually. They just have to guess and hope the track isn't overly loud when the volume is up.