fix(processor): add adaptive floor to levelling-compressor threshold#131
Merged
Conversation
Floor the elected speech RMS at the full-file overall RMS before the +9 dB offset, so an anomalously-quiet speech election cannot drag the threshold too low. Measurement-derived (no magic constant), raises only, fixes 3 stems with quiet-region anomalies and 13 others with minor quiet bias. Output LUFS and true peak held to spec; dynamics on affected stems measurably gentler. Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 3/5
- In
internal/processor/adaptive_levelling_compressor.go, the floor logic currently treats missing astats RMS as 0 dBFS, which can raise the adaptive threshold too aggressively and cause incorrect compression behavior in output audio; add an explicit “RMS was measured” guard before applying the floor so absent stats don’t influence thresholding before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…stats When astats fails to measure RMS, Dynamics.RMSLevel stays at 0.0 (the unmeasured sentinel). The previous NaN/Inf guard did not catch this, causing the floor max(speechRMS, 0.0) to pin the threshold to -6 dBFS. Guard now checks for finite sub-zero levels only, treating 0.0 as unmeasured and leaving the floor inert, matching the codebase convention. Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Auto-approved: Adds an adaptive floor to the levelling-compressor threshold to guard against unusually quiet speech by comparing speech RMS to full-file RMS. Changes are isolated to a single core function and are well-documented with tests.
Re-trigger cubic
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.
Floor the elected speech RMS at the full-file overall RMS before the +9 dB
offset, so an anomalously-quiet speech election cannot drag the threshold too
low. Measurement-derived (no magic constant), raises only, fixes 3 stems with
quiet-region anomalies and 13 others with minor quiet bias. Output LUFS and
true peak held to spec; dynamics on affected stems measurably gentler.