Repository navigation
fix(cli): normalize-audio --reference stops short of the peak ceiling instead of refusing - #7254
Conversation
… instead of refusing
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head d40aa021
- nit:
packages/cli/README.md:70-71still says the command "refuses unsafe boosts that exceed Studio's +12 dB ceiling or would clip".docs/packages/cli.mdxgot the new wording, but the README didn't, so it now describes the old behavior.
Scope
Read the whole diff, plus normalizeAudio, plannedNormalization and absoluteOutcome. fittedGain gives the same result as the absolute-mode reduce it replaces. With previousGainDb = -Infinity (volume 0), the boost guard is a no-op, so applied = limited. The "under the reference" figure can't go negative, because applied ≤ wanted on both the boost and cut branches. The reference-mode heldAtLimit matches absoluteOutcome === "held" under the !withinTolerance gate. No other callers of audioNormalizationPlan exist outside the CLI. Intended behavior change: matches that land between -1.5 and 0 dBTP used to be written in full and now stop at -1.5 dBTP; the docs cover this.
Fails-without-fix check: with main's loudness.ts and normalize-audio.ts, the 4 named tests fail and the other 31 pass. At head, all 35 CLI tests and 47 studio-server loudness.test.ts tests pass. CI was still running at review time (CI, Docs, CodeQL, Windows render); nothing had failed.
— Genesis V2 reviewer
…s instead of refusing
Edit accuracy: accurate 267 (base branch 267), smooth 107 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (2)
|
…view Adopts heygen-com#7240 (deferred frame extraction leaves the distributed code), heygen-com#7241 (a capture segment extracts and deletes its own frames), heygen-com#7255 (segmented and sequential capture check drawElement samples), heygen-com#7254 (normalize-audio --reference stops short of the peak ceiling), heygen-com#7256 (engine names a failed script's origin first), heygen-com#7258 (SVG gradient text judged by its stops) and heygen-com#7242 (windowed source frames, off unless HF_VIDEO_FRAME_WINDOW=true). Release v0.9.17 is not synced wholesale; the producer packed budget takes upstream's +12000 from this range. Watermark advances to 32eb4c3. Co-authored-by: Vance Ingalls <vance@heygen.com> Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
hyperframes normalize-audio --reference <a> --target <b> --writeno longer refuses when a full match would push the target past Studio's ceilings. It applies the most gain that fits under -1.5 dBTP and the +12 dB authoring ceiling, writes it, and says how far under the reference that leaves the target:Why
A report: matching a closing speaker to the opening one refused the write with "Matching #speaker-closing would clip at +1.5 dBFS; limit or preprocess the source first". The absolute mode of the same command (
--targetwith a LUFS goal) already handles this case another way: it never refuses, stops at the same ceilings, and names the limit. One command had two rules for one constraint, and the stricter one left the person with an error and nothing written.How
fittedGaininloudness.tspicks the most of the wanted gain under both ceilings and names the limit that stopped it.absoluteLoudnessPlanandaudioNormalizationPlanboth call it. A limit still never cuts gain already authored when the wish is a boost.audioNormalizationPlanreturnslimitedBylike the absolute plan, so--jsoncarries it too.docs/packages/cli.mdxand the CLI README say what the command does now instead of "refuses".Test plan
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
fails without the fix: with main's
loudness.tsandnormalize-audio.ts, the 4 new tests fail: "writes the most gain that stays under -1.5 dBTP and says how far under the reference that leaves it" (the command, with--write: the printed line and the writtendata-volume="1.188502"), "stops a boost at Studio's +12 dB ceiling and names it", "stops a boost that would pass -1.5 dBTP there, as the absolute target does", "names no limit when the match fits". All pass here.3 runs in a row:
normalize-audio.test.tsandnormalize-audio.command.test.ts(35 tests), andstudio-server'sloudness.test.ts(47), whose absolute-plan tests now run through the sharedfittedGain.oxfmt --check, the comment ratchet andtscforstudio-serverclean. The CLI'stscreports only 5 errors incheckFindingInspectandcheckTypes, which import@hyperframes/inspector(not built in that tree); this PR doesn't touch them.Not covered: a run on a real recording; the measurement step is mocked in the command test, as the existing command tests do.