You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow setting ReplayGain values for MPC (Musepack) #923
It’s of course mandatory for a replaygain tool to be able to write the calculated values, even in the header area. It seems that others (like Amarok) also see this problem.
I wouldn’t want to introduce yet another dependency in loudgain, so I kindly ask if this restriction could please be removed in TagLib.
At the moment those values are part of the AudioProperties, not part of the Tag. For all file types in TagLib, AudioProperties are read only. In this particular case, MPC does use an odd mix metadata and format data in its headers that I'm not aware of existing in any other format.
At any rate, the issue isn't simply the structures being const -- it's that there's no code for writing those properties at all; they're just read-only internally, so making them read-write would require both code for writing those files back to the original files, and updates to the MPC::File API.
Yes, I agree that’s an odd situation, Musepack being the only format that holds ReplayGain data in the header. Somehow good and bad. Still I would love to see this possible, if anyhow doable. I also found an old comment from the Amarok developers somewhere, complaining that "TagLib doesn’t let us at the values". They worked around it by writing APEv2 tags, apparently, but that’s non-standard, since almost all players I could find only read the ReplayGain header data.
Writing a ReplayGain tool, it’s of course mandatory to be able to write the correct values, and I quite like TagLib for its clarity and structuredness, so it would be just great to have it (and maybe even make others happy).
In general, I think it might be good if TagLib could allow (selected?) fields in headers been rewritten, thinking of the Opus output_gain field … (see #916).
Thanks. Also problematic was lower in the file where toShort instead of toUShort was used. Unfortunately there are still no tests for decoding SV7, so I'll see if some can be created before the upcoming release.
N.B.: Might be nice to also consider the "ReplayGain version" field for writing, I might need to write a "2" there … It’s 8 bit, but the spec is a little unclear if signed or not.
Activity
scotchi commentedon Sep 12, 2019
This does bring up an interesting question --
At the moment those values are part of the
AudioProperties, not part of theTag. For all file types in TagLib,AudioPropertiesare read only. In this particular case, MPC does use an odd mix metadata and format data in its headers that I'm not aware of existing in any other format.At any rate, the issue isn't simply the structures being const -- it's that there's no code for writing those properties at all; they're just read-only internally, so making them read-write would require both code for writing those files back to the original files, and updates to the
MPC::FileAPI.Moonbase59 commentedon Sep 12, 2019
Thanks for caring!
Yes, I agree that’s an odd situation, Musepack being the only format that holds ReplayGain data in the header. Somehow good and bad. Still I would love to see this possible, if anyhow doable. I also found an old comment from the Amarok developers somewhere, complaining that "TagLib doesn’t let us at the values". They worked around it by writing APEv2 tags, apparently, but that’s non-standard, since almost all players I could find only read the ReplayGain header data.
Writing a ReplayGain tool, it’s of course mandatory to be able to write the correct values, and I quite like TagLib for its clarity and structuredness, so it would be just great to have it (and maybe even make others happy).
In general, I think it might be good if TagLib could allow (selected?) fields in headers been rewritten, thinking of the Opus output_gain field … (see #916).
Moonbase59 commentedon Sep 12, 2019
Reading the SV7 spec, I just found that apparently the "gain" values are signed int whereas the "peak" values are not.
In
taglib/mpc/mpcproperties.cpp, you haveunsignedfor all values:For the SV8 spec, I’m a little unsure because they talk of negative and positive numbers, apparently Q8.8 encoded.
scotchi commentedon Sep 12, 2019
Thanks. Also problematic was lower in the file where
toShortinstead oftoUShortwas used. Unfortunately there are still no tests for decoding SV7, so I'll see if some can be created before the upcoming release.Moonbase59 commentedon Sep 12, 2019
Let me know if you need a few test files, I have some here for my loudgain testing.
Moonbase59 commentedon Sep 12, 2019
N.B.: Might be nice to also consider the "ReplayGain version" field for writing, I might need to write a "2" there … It’s 8 bit, but the spec is a little unclear if signed or not.
scotchi commentedon Sep 12, 2019
If you have some with a SV7 headers, that'd be great, particularly if they have a negative gain. You can send them to [email protected].
Moonbase59 commentedon Sep 12, 2019
With pleasure, I’ll just go and zip ’em up. Will 42 MB fit into your email? (They’re real files, not just shortened tests.)
EDIT: Attachment too large for my own mail server, I sent you a mail with a download link.