mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
feat(studio,lint): carve targets voiceover groups — always, when plural
Plural voiceover carve now targets a group instead of naming each clip: `resolveCarveSourceIds` (core `audioGroups.ts`) expands a group id to its current members at analysis time, so a clip added to the group later is covered without touching `sources`. The picker (`useFxCarve.ts`) offers a grouped voice as one option instead of one row per member, tests overlap as a union of member spans (a group overlaps the bed if ANY member does), and prefers a qualifying group over its individual members in `autoSourceIds`. Picking two or more ungrouped voice clips in the carve flow now mints a group behind them (`mintGroupId`, de-duped against every id in the document) and writes `data-audio-group` on each picked clip atomically, one undo entry — `createAudioGroupAndAssignMembers` in `timelineTrackVisibility.ts` copies `setElementsHidden`'s multi-target write shape. The DSP is untouched: `mixCarveSources` already sums multiple sources correctly (verified in the design doc's own investigation) — this only fixes the picker. New lint rule `audio_carve_ungrouped_sources` (`packages/lint/src/rules/ media.ts`, alongside `audio_volume_double_automation`) warns when a `data-fx-carve`'s `sources` names two or more plain clip ids instead of a group — the shape that silently rots when a clip is added. `/hyperframes- audio` states the same rule as an invariant, not a tip, with the grouped- narration HTML example from the design doc. The group-matching and auto-group logic (`withAutoGroupedSources`, `collectCarveCandidates`) is split into `useFxCarveGrouping.ts` — `useFxCarve.ts` was pushing past the 600-line cap. `resolveNextCarveSettings` is deliberately NOT an `async function`: wrapping it in one would force a microtask on every call, including the synchronous branch — the exact bug `withAutoGroupedSources`'s own sync-when-possible contract exists to avoid, and one caught via `propertyPanelAudioFxGroup.test.tsx` (10 failures) before fixing it back to a plain function the caller conditionally awaits. Also extracted `useEffectiveTimelineDuration` out of `App.tsx` and `useRemoveBackground` out of `StudioRightPanel.tsx` (both pushed past 600 lines from an added prop wire), and decomposed `useFxCarve.ts`'s picker IIFE to clear fallow's complexity gate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
5dc93a25ad
commit
351b219d2b
@@ -236,6 +236,31 @@ so one analysis covers all of them: the bands come from all the speech there is,
|
||||
the envelopes rise wherever any of it is happening. Voices that never play while the
|
||||
bed does are left out; they cannot mask it.
|
||||
|
||||
**A carve against more than one clip id is wrong. Group the clips and carve
|
||||
against the group.** This is an invariant, not a tip. Naming clips one by one has
|
||||
to be exhaustively right and stays right only until the next edit — a fourth
|
||||
narration clip added later plays outside the carve's awareness, and the bed
|
||||
fails to duck under it silently. Naming the group instead resolves membership at
|
||||
analysis time, so a clip added to the group later is covered without touching
|
||||
`sources` at all:
|
||||
|
||||
```html
|
||||
<!-- group the narration, then carve the bed against the group -->
|
||||
<audio id="vo-intro" data-audio-group="voiceover" …></audio>
|
||||
<audio id="vo-middle" data-audio-group="voiceover" …></audio>
|
||||
<audio id="vo-outro" data-audio-group="voiceover" …></audio>
|
||||
|
||||
<audio
|
||||
id="music"
|
||||
data-fx-carve='{"enabled":true,"sources":["voiceover"],"strength":0.25}'
|
||||
…
|
||||
></audio>
|
||||
```
|
||||
|
||||
A `sources` list naming two or more plain clip ids instead of a group is caught
|
||||
by the `audio_carve_ungrouped_sources` lint rule — it still works, but it is the
|
||||
version that silently rots when a clip is added.
|
||||
|
||||
**One knob.** `strength` is 0..1 and derives everything: how deep to cut, how
|
||||
many bands, how wide, how far to favour intelligibility over raw voice energy,
|
||||
how far the level may drop, how far under the voice to aim. Those six move
|
||||
|
||||
Reference in New Issue
Block a user