Skip to content

Commit 9244c47

Browse files
vanceingallsclaude
andauthored
feat(studio): normalize loudness and duck under voice, with a limiter report (4/8) (#4816)
* feat(studio-server): share loudness measurement with an absolute target and video support normalize-audio moves its measure/plan code into @hyperframes/studio-server/loudness, gains an absolute mode (--lufs, default -16, clamped at +12 dB and -1.5 dBTP) and accepts <video> clips with sound. Adds the @hyperframes/core/audible-video subpath. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(studio-server): add a measure-only loudness normalize endpoint POST /projects/:id/loudness/normalize measures a clip's played window (audio or video) and answers the -16 LUFS data-volume plan; Studio writes the attribute. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: register the loudness and audible-video subpaths in their descriptors Co-Authored-By: Claude Opus 5.5 <[email protected]> * style: format the loudness and audible-video subpath descriptors Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(studio): add Normalize loudness and Duck under voice to the clip menu Normalize measures the clip on studio-server and writes data-volume as one undoable edit; Duck toggles a carve against every overlapping voice (audio or video with sound) at the default strength. Both live in clipMenuAudioItems with one hook-in. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(studio): tighten carveOutput docs to the package comment share Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(producer): report how far the true-peak limiter lowered the export The AAC true-peak pass now returns its attenuation; the render logs "Audio lowered by X.X dB to stay under -1 dBTP" and sets RenderJob.audioLoweredDb, which Studio servers carry in the complete SSE event and the /renders record. Also exports useAudioMetersVisible from @hyperframes/studio for hosts. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(studio-server): scan HTML start tags without a backtracking regex The start-tag regex backtracked quadratically on '<' followed by many spaces (CodeQL js/polynomial-redos). A linear character scan reads the same name. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(studio): refuse to normalize a volume-automated clip and honour save outcomes A volume lane owns the clip's gain in preview and render, so writing data-volume changed nothing while the toast claimed success; Normalize now refuses with a clear message. Normalize and Duck also check each quiet-save outcome, stop at the first failed or refused write and report it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(core): drop the duplicate audible-video subpath descriptor Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 880b4c4 commit 9244c47

34 files changed

Lines changed: 1935 additions & 512 deletions

‎packages/cli/src/commands/normalize-audio.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,13 @@ describe("updateAudioVolume", () => {
175175
);
176176
});
177177
});
178+
179+
describe("normalize-audio on video clips", () => {
180+
it("finds a video with sound as a target and skips a muted one", () => {
181+
const html = `<video id="a-roll" src="talk.mp4" data-has-audio="true"></video><video id="b-roll" src="b.mp4" muted></video><audio id="music" src="m.mp3"></audio>`;
182+
expect(audioTags(html).map((tag) => tag.id)).toEqual(["a-roll", "music"]);
183+
expect(updateAudioVolume(html, "a-roll", 0.5)).toContain(
184+
`<video id="a-roll" src="talk.mp4" data-has-audio="true" data-volume="0.5"></video>`,
185+
);
186+
});
187+
});

0 commit comments

Comments
 (0)