namidaco / namida

A Beautiful and Feature-rich Music & Video Player with Youtube Support, Built in Flutter
Other
2.28k stars 137 forks source link

[Feature Request] ReplayGain tag support #57

Open thezeroalpha opened 1 year ago

thezeroalpha commented 1 year ago

ReplayGain tags store info that allows media players to normalize the perceived loudness of audio across files. The media player can read that tag, and amplify or attenuate a given track based on the value. This is nice because you can set your volume to a certain level, and all tracks will play at around that level. ReplayGain values can either be per-track (so each track plays at a certain volume), or per-album (so the whole album plays at a certain level, with tracks in the album at dfferent levels). It would be great if Namida supported this.

(As a follow up, since this would mean implementing gain/attenuation functionality, that could also be exposed to the user as a setting, so they can boost the volume of playback if needed.)

MSOB7YY commented 1 year ago

that's interesting, this might require internal setup for the audio library, gonna check it out. can you provide some 1-2 files that has the replayGain tag? also is it only an ID3v2 tag? (i.e. not available with Media Store)

thezeroalpha commented 1 year ago

Sure, I'm attaching two royalty-free tracks that have both track and album replaygain values, calculated with mp3gain.

There's a few options, the newest format uses only ID3v2 frames, and there's two legacy formats -- here's the spec. The spec also supports Vorbis comments and APEv2. But either way I don't think it's something that would be supported by Media Store, I found a similar discussion in the Auxio repo.

MSOB7YY commented 1 year ago

thanks so much for the detailed report, i will look into this after finishing some stuff with YouTube and local video playback, so it might take some time, thanks again 🌺

thezeroalpha commented 1 year ago

Of course, thanks for your work and openness to feedback! (I'm also the dude from reddit)

MSOB7YY commented 1 year ago

oh coolio! nice to see you here lmao, thank u for ur recommendations and patience too!

MSOB7YY commented 2 months ago

hey its been a while quick update, the recent changes to audio tagger allowed extracting raw TXXX data, which made it so easier to implement replay gain here is the info extracted for "titatnium" track in the sample u sent

{
  "replaygain_album_gain": "-0.040000 dB",
  "replaygain_album_peak": "0.449919",
  "replaygain_track_gain": "-0.515000 dB",
  "replaygain_track_peak": "0.449919",
  "replaygain_reference_loudness": "89.0 dB",
  "MP3GAIN_ALBUM_MINMAX": "061,205",
  "MP3GAIN_MINMAX": "061,205",
  "MP3GAIN_UNDO": "+005,+005,N",
  "bitRate": 256,
  "sampleRate": 48000,
  "channels": "Joint Stereo",
  "encodingType": "MPEG-1 Layer 3"
}

there are info like MP3GAIN_ALBUM_MINMAX, MP3GAIN_MINMAX, MP3GAIN_UNDO which i dont understand, i think it has no use but if u know smth about them let me know

i will now start working on this, sorry for being late and thanks for requesting.