Repository navigation
Fix volume filter normalization applying gain to the first sample only - #1351
Merged
ddennedy merged 1 commit intoOct 25, 2026
Merged
Conversation
Since channel_mask was added, the s16 normalize path read and wrote p[0] for every sample instead of the sample of the current channel. The audio was left unscaled while the first sample was multiplied repeatedly, and whenever the gain was above 1 every sample was replaced by a value derived from that first sample, which turned the signal into a near constant. Regressed in 3412c3f.
Member
|
Thank you for the fix. FYI, the normalize function of the volume filter is deprecated as documented https://mltframework.org/plugins/FilterVolume/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since channel_mask was added, the s16 normalize path read and wrote p[0] for every sample instead of the sample of the current channel. The audio was left unscaled while the first sample was multiplied repeatedly, and whenever the gain was above 1 every sample was replaced by a value derived from that first sample, which turned the signal into a near constant. Regressed in 3412c3f.
Reproduced by a -30 dBFS tone through
volume gain=normalizethat came out as a near-constant square wave on master (8 zero crossings, peak 32767), a properly scaled sine with the fix (66 zero crossings, peak 10360).