Repository navigation
fix(producer): an export over the ceiling limits its peaks and keeps the mix's level - #6940
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Edit accuracy: accurate 271 (base branch 271), smooth 109 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
2bfdb34 to
374db34
Compare
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 2 nits · head 374db34b
Checked the fails without the fix: claim. With audioStage.ts reverted to base, runAudioStage › limits the mix's peaks before the whole-mix cut measures it fails (actual value must be number or bigint, received "undefined"). At head, both touched test files pass (20/20) and producer tsc --noEmit is clean. Also checked: the -3 dBTP / 1.7 dB overshoot reasoning matches the hf-truepeak docstring, and chainLatencySamples trims the lookahead in the offline render, so the limited PCM stays aligned with the picture.
Nits and scope
audioDeliveryLimit.ts:52: the code encodeslimitedPathand ignores thepaththatapplyChainreturns.applyAudioFxChainreturns the input path without writing anything when the PCM has zero frames, and thenencodewould fail on a file that does not exist. A mix that is over the ceiling can't really have zero frames, but encoding the returnedpathcosts nothing.audioDeliveryLimit.ts:54-58: when the limit fails and the render goes on with the flat cut, any partialaudio-source-limited.wavstays inworkDir. ThefinallyinrunAudioStageremoves onlyaudio-source.wav. Adding aremoveScratch(limitedPath)on that path would clean it up.
Scope: read the full diff, applyAudioFxChain, constrainAacTruePeak, and the runtime latency trim. CI was still running at review time and no check had failed. I did not listen to the audio; the sound of the limited exports is left to the listening clips.
…view Adopts heygen-com#7250 (SVG stroke drawing is not a dead stretch), heygen-com#7248 (contract check reads a timeline registered in a local script), heygen-com#7252 (comma-list selectors hidden by authored CSS), heygen-com#7238 (snapshot and preview show a clip on the render frame), heygen-com#7237 (stalled cloud upload retries) and heygen-com#7251 (per-scene SVG id namespacing), with prerequisite heygen-com#6829. Defers heygen-com#7246 (needs the delivery limiter from heygen-com#6940) and heygen-com#7232 (needs the WebKit decode-first pipeline), with conditions in the ledger. Watermark advances to b108f85. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
An export whose mix passes the delivery ceiling now comes down peak by peak, so quiet passages keep their level. Before, the whole file was lowered by one flat amount.
Why
Export keeps the delivered file under -1 dBTP. When a peak passed that,
constrainAacTruePeakturned the whole mix down withvolume=, so one loud moment made an entire film several dB quieter. #6938 made that cut visible; this replaces it for the mixes it can.limiteron their groupRelated work
Builds on #6938, which prints the
audio_loweredwarning.How
limitDeliveryPeaks(new,audioDeliveryLimit.ts), called fromrunAudioStageafter the first encode: if the encoded mix is over the ceiling, it runs the kept PCM through atruepeaknode at -3 dBTP and encodes again. -3 is the marginaudio-effects.mdxalready gives for a -1 dBTP limit.constrainAacTruePeakstill runs after it, as the backstop for anything that gets over, and prints the same warning. If the limit cannot run, the log says so and the flat cut applies as it does today. A failed encode of the limited mix fails the render.@hyperframes/enginenow exportsapplyAudioFxChain.Tradeoff: this changes the sound of every export that goes over. A mix far over the ceiling is held hard rather than turned down: the two-clip film needs about 8.6 dB of gain reduction on its bursts (+5.6 dB sum to -3 dBTP), which can be audible as distortion on dense material. Preview has no delivery limit, so an export can differ from its preview on those peaks. The separate check in
padOrTrimAudioToVideoFrameCountstill uses the flat cut.Test plan
audioDeliveryLimit.test.ts(under the ceiling does nothing; over it re-encodes through the limit; a limit that cannot run leaves the flat cut and warns; a failed encode fails; no source does nothing), andlimits the mix's peaks before the whole-mix cut measures itinaudioStage.test.ts.runAudioStagefails that test.packages/producer: both files passed 3 runs in a row;audioPadTrim.test.ts40 passed underbun test;tsc --noEmitclean.hyperframes renderexports on Linux, measured with ffmpeg (astatsfor the quiet tone,ebur128=peak=truefor peaks). Peaks after: -2.8, -2.8, -2.9 dBFS. A film already under the ceiling kept its level and -4.0 dBFS peak, with no warning.