Skip to content

fix(processor): insert aresample between loudnorm and adeclick in Pass 4#98

Merged
flexiondotorg merged 2 commits into
mainfrom
pass4-fix
May 31, 2026
Merged

fix(processor): insert aresample between loudnorm and adeclick in Pass 4#98
flexiondotorg merged 2 commits into
mainfrom
pass4-fix

Conversation

@flexiondotorg
Copy link
Copy Markdown
Contributor

loudnorm in linear mode upsamples internally to 192 kHz and emits at that rate. Without resampling back to source rate, adeclick and downstream analysis filters processed 4× sample count, causing ~4.5× slowdown on Pass 4.

  • Add sourceSampleRate parameter to buildLoudnormFilterSpec(), guard aresample
  • Move Pass 4 progress reporting to OnInputFrame for steady cadence
  • Add TestBuildLoudnormFilterSpecSourceRateResample guard test (two subtests)
  • Update docs and AGENTS.md with rate discovery and impact analysis

Measured impact: 4.21s → 0.94s per 60s segment (4.5× faster).

loudnorm in linear mode upsamples internally to 192 kHz and emits at
that rate. Without resampling back to source rate, adeclick and
downstream analysis filters processed 4× sample count, causing ~4.5×
slowdown on Pass 4.

- Add sourceSampleRate parameter to buildLoudnormFilterSpec(), guard
  aresample
- Move Pass 4 progress reporting to OnInputFrame for steady cadence
- Add TestBuildLoudnormFilterSpecSourceRateResample guard test (two
  subtests)
- Update docs and AGENTS.md with rate discovery and impact analysis

Measured impact: 4.21s → 0.94s per 60s segment (4.5× faster).

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Confidence score: 4/5

  • This PR looks safe to merge overall; the only reported issue is documentation wording, not a runtime or functional regression risk.
  • In docs/FilterLimiter-CBS-Volumax.md, the heading "Filter chain when not clamped (unchanged):" conflicts with the actual chain update (insertion of aresample between loudnorm and adeclick), which could mislead readers about current behavior.
  • Because the issue is limited to doc accuracy (severity 5/10) and has clear, straightforward remediation, merge risk remains minimal.
  • Pay close attention to docs/FilterLimiter-CBS-Volumax.md - fix the "(unchanged)" annotation so the documented filter chain matches the updated sequence.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/FilterLimiter-CBS-Volumax.md
The "(unchanged)" annotation could be misread as unchanged by the
aresample edit; it actually meant "same chain as the clamped variant".
Reword to "(no pre-gain)" to state the real distinction (the not-clamped
path drops the leading volume pre-gain stage).

Addresses cubic review feedback on PR #98.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: This change modifies the core audio processing filter chain in normalise.go by inserting an aresample filter between loudnorm and adeclick, which is a functional logic change that could affect audio quality and processing correctness, so a human reviewer should verify the insertion and the new...

Re-trigger cubic

@flexiondotorg flexiondotorg merged commit 256b523 into main May 31, 2026
16 checks passed
@flexiondotorg flexiondotorg deleted the pass4-fix branch May 31, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant