Loudness normalization for reference audio (BS.1770-4)#9
Merged
Conversation
…arity) - New R/loudness.R: integrated_loudness() and normalize_loudness(), a pure base-R port of pyloudnorm's K-weighting meter (matches to 6 decimals on synthetic and real audio). - create_voice_embedding() gains norm_loudness; defaults follow Python (TRUE for turbo, FALSE for standard). - read_audio() now downmixes stereo by channel mean (librosa parity); it previously dropped the right channel silently.
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.
Ports Python turbo's
norm_loudness(pyloudnorm, ITU-R BS.1770-4) to pure base R and closes the one real turbo parity gap found in the 0.1.7 review.integrated_loudness()+normalize_loudness()— K-weighting (two RBJ biquads viastats::filter), gated 400 ms blocks at 75 % overlap. No new dependencies.scripts/save_loudness_ref.py), hardcoded ininst/tinytest/test_loudness.R.create_voice_embedding(norm_loudness=): defaults match Python — TRUE for turbo, FALSE for standard.read_audio()stereo fix: validation surfaced that stereo files silently dropped the right channel; now downmixes by channel mean (librosa parity). Only caller iscreate_voice_embedding(blast_radius checked).Full tinytest suite passes (0 failures),
document()clean.