complexlogic / rsgain

A simple, but powerful ReplayGain 2.0 tagging utility
Other
289 stars 21 forks source link

Musepack tags are not written to Musepack Header (only written into comment tags, but their support in music players is optional) #79

Closed magicgoose closed 1 year ago

magicgoose commented 1 year ago

https://wiki.hydrogenaud.io/index.php/ReplayGain#Musepack_ReplayGain

Notes: ReplayGain values are stored in the header and ReplayGain is part of the Musepack specifications; therefore any Musepack decoder that does not support ReplayGain can be considered broken.

This makes MPC's own ReplayGain tag more useful/universal.

complexlogic commented 1 year ago

A challenging aspect of audio metadata is that what is written down in reference materials is not necessarily what is implemented in practice. From what I can tell, most players implement ReplayGain for Musepack via the APEv2 tags. Are there any players that you are aware of that only read the headers?

magicgoose commented 1 year ago

For some time, latest preview(1.4.x) builds of foobar2000 for Android were only able to work with header gain info in MPC files, but soon after I opened this ticket, the author clarified that this was not intentional and promised to restore support for ReplayGain in Musepack via the APEv2 tags.

So, from personal PoV, it is not that critical now.

I also did a bit of research in the meantime, how it could be done - it's a bit convoluted, so it definitely makes sense to not spend time on it if there are ways around it.

there are more details in https://hydrogenaud.io/index.php/topic,124767.0.html

complexlogic commented 1 year ago

I've already implemented writing to the Musepack header. The program's current functionality writes all zeros to the RG header, effectively clearing any preexisting info to avoid conflicts with the RG info stored in the APEv2 tag.

I will consider adding an option to write to the header instead of APEv2 tag in a future version.

complexlogic commented 1 year ago

After reviewing the matter, I now recall why I didn't support writing gain to the Musepack header when I first implemented Musepack support. The Musepack header actually uses loudness values, not gain, and they are the dB SPL values specified by ReplayGain 1.0. This is a ReplayGain 2.0 scanner, and there is no one-to-one conversion factor between LUFS and dB SPL.

I'm going to keep the existing behavior for Musepack, i.e. write zeros to the header, save ReplayGain values as APEv2 tag. From the thread you linked, it sounds like the issue was fixed in Foobar, so you should be good regardless.

magicgoose commented 1 year ago

there is no one-to-one conversion factor between LUFS and dB SPL

as I understood, it can be meaningfully converted, it's just a rather weird formula. but yes, with regards to foobar, this is no longer a problem.