[API Request] Expose ReplayGain tags in song/track payload #10
Replies: 4 comments 3 replies
-
And this is really niche, (but also really easy).. We could also add a Pre-emphasis was a technique used on some early CDs to mitigate poor linearity of early ADC/DACs by boosting the treble of the track before digitizing it, flagging it in the CD metadata, and having the player do the corresponding treble cut in the analog domain after the DAC. Even though it hasn't really been used since the 80s it's part of the Red Book CD-DA spec and all CD players should support it. CD rips won't automatically correct it though, and the standard thing to do is run the rip through SoX or a similar post-processor that can correct pre-emphasis. Or add a PRE_EMPHASIS=1 tag and use a player like Foobar2000 that can correct it in real-time. Any Subsonic client that uses libmpv for playback, or an audio backend that lets you add biquad filters to the signal chain, can correct pre-emphasis on the fly as well, provided they can know if it is present in the files. |
Beta Was this translation helpful? Give feedback.
-
That's a very simple one I think should definitely be added |
Beta Was this translation helpful? Give feedback.
-
Thinking more about this, if we pick this one up there needs to be a way to distinguish between a server not supporting replaygain metadata vs a specific file not containing it. So either make it mandatory under a certain OpenSubsonic API version that replaygain tags must be scanned and returned by the API, or adding a |
Beta Was this translation helpful? Give feedback.
-
See proposal #52 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Type of change
API extension
Proposal description
ReplayGain is an accepted standard for loudness normalization and many media files in users' collections will already have ReplayGain tags (and it's easy to scan for and add them). Currently some clients are able to use ReplayGain tags present in the files themselves, but this is not ideal since a) some transcoding setups may not preserve the file tags, and b) some clients, especially web-based ones, won't have access to reading the tags in the streamed audio file itself.
Implementing replaygain loudness normalization is very easy on the client side if you have access to the tags, since it can be done by setting the volume of the internal player based on a simple formula.
Backward compatibility impact
Additional properties on track struct. No break in backwards compatibility
Backward compatibility
API details
Add additional properties to the song structure:
trackGain
,trackPeak
,albumGain
,albumPeak
. All 4 are float values, and the units for trackGain and albumGain are dB, and trackPeak and albumPeak are in the range [0.. 1]. The corresponding tags in the audio files to read from areREPLAYGAIN_TRACK_GAIN
, etcIf a track is missing replay gain info, the server must omit the replaygain fields from the response rather than setting them to 0.
Security impacts
No response
Potential issues
No response
Alternative solutions
No response
Beta Was this translation helpful? Give feedback.
All reactions