mucke icon indicating copy to clipboard operation
mucke copied to clipboard

Replaygain support

Open wozeparrot opened this issue 2 years ago • 8 comments

Would it be possible to add replaygain support? Most of the other open source music players include it.

wozeparrot avatar Jan 13 '23 20:01 wozeparrot

It looks like I'm not getting any replay gain information for the music files. So unfortunately, this is rather unlikely to be implemented. A manually set gain for all songs, per album, or per song should not be a problem, though.

moritz-weber avatar Feb 08 '23 20:02 moritz-weber

Poweramp supports album and track gain from music files. So it's certainly possible. And for a musicplayer that's largely based on shuffle play it's essential.

KolyaKorruptis avatar May 17 '23 19:05 KolyaKorruptis

@FriederHannenheim do you think, it would be possible (and viable) to get the replay gain info via metadata_god?

moritz-weber avatar Aug 26 '23 18:08 moritz-weber

Yes it should be possible. metadata_god doesn't support it by default but since we're using my own fork anyway I could add that. I will look into it in the coming days

FriederHannenheim avatar Aug 26 '23 20:08 FriederHannenheim

@moritz-weber I added ReplayGain support to metadata_god in my fork. If you want to use it just run flutter pub upgrade. There are new fields on Metadata for TrackGain/TrackPeak and AlbumGain/AlbumPeak. If you want to I can look into implementing this in mucke or you could do it yourself. I'm not so sure how to do it.

FriederHannenheim avatar Sep 01 '23 10:09 FriederHannenheim

@FriederHannenheim thanks for the great work. If you like, you can look into this topic. I have no experience with replay gain myself. Maybe, @wozeparrot and @KolyaKorruptis can give us some hints. Perhaps point to an app that implements this well.

As for the implementation in mucke, I suspect that we would need to calculate the desired volume level for each song - given the fields that you mentioned in your comment - and then set the volume accordingly.

The AudioSource class that describes the songs in terms of the actual audio player does not have an option to specify the volume. Thus, we would probably need to set the volume for every song by listening to some stream (e.g. current index or song stream).

just_audio has a method for that: player.setVolume(0.5);

moritz-weber avatar Sep 10 '23 00:09 moritz-weber

gain information is written into the file beforehand by tools like mp3gain. you don't need to calculate it. these tools usually calculate album gain and track gain, but for a shuffle play centered player like mucke only track gain is interesting.

KolyaKorruptis avatar Sep 10 '23 13:09 KolyaKorruptis

Thanks for the response. I tested mp3gain, but I'm not really sure, how to interpret the results. For example:

Song x has a recommended track gain g = -0.435 dB. I'm guessing, this means that the song is a bit too loud. In our case, we would need to calculate a linear value from the dB value: l = 10^(g/20) = 0.95. So we would need to call setVolume(0.95).

Does this make sense?

moritz-weber avatar Sep 10 '23 21:09 moritz-weber