mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
fix(lint): say the audio overlap warning is about a shared Studio lane (#7700)
duplicate_audio_track said two overlapping clips on one data-track-index "cause layered audio playback" and suggested moving one to another track. The render's mixer never reads data-track-index (every audible clip is its own amix input) and the docs call the attribute a Studio lane only, so the two clips are layered whatever their tracks: rendering a whoosh and a hit on track 6, then with the hit on track 7, gives byte-identical audio. The message now says both play and that the overlap is two clips sharing one Studio lane; the hint says splitting tracks leaves the mix unchanged, and that a leftover duplicate should be removed or moved. lint-rules.mdx said the audio "doubles up"; it now says the same as the message. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
213f7c5383
commit
3ce9ebeaf1
@@ -916,9 +916,9 @@ Source: the project lint pass in `packages/lint/src/project.ts`, `packages/lint/
|
||||
|
||||
### `duplicate_audio_track`
|
||||
|
||||
**Warning.** Two audible elements overlap on the same track index, so their audio doubles up.
|
||||
**Warning.** Two audible clips overlap in time on the same `data-track-index`. Both play at once: the render mixes every audible clip whatever its track, and `data-track-index` only picks the Studio lane, so Studio draws the two over each other in that lane. An overlap like this is either an accidental duplicate or two sounds sharing one lane.
|
||||
|
||||
**Fix:** Use non-overlapping time windows or different track indices.
|
||||
**Fix:** If both should sound (a whoosh into a hit), give one its own `data-track-index`; the mix does not change. If one is a leftover duplicate, remove it or move it so the windows do not overlap.
|
||||
|
||||
### `texture_mask_asset_not_found`
|
||||
|
||||
|
||||
@@ -1307,6 +1307,23 @@ describe("audio-aware project rules", () => {
|
||||
expect(codes).toContain("duplicate_audio_track");
|
||||
});
|
||||
|
||||
it("says both clips still play, since the track index only picks the Studio lane", async () => {
|
||||
const sfx = (id: string, start: string, duration: string) =>
|
||||
`<audio id="${id}" src="${id}.wav" data-start="${start}" data-duration="${duration}" data-track-index="6"></audio>`;
|
||||
const project = makeProject(
|
||||
composition(sfx("whoosh", "5.13", "0.7") + sfx("land", "5.79", "0.34")),
|
||||
);
|
||||
const { results } = await lintProject(project);
|
||||
const finding = results
|
||||
.flatMap((result) => result.result.findings)
|
||||
.find((f) => f.code === "duplicate_audio_track");
|
||||
expect(finding?.message).toContain("whoosh.wav at 5.13-5.83s and land.wav at 5.79-6.13s");
|
||||
expect(finding?.message).toContain("Both play at once whatever their track");
|
||||
expect(finding?.fixHint).toContain(
|
||||
"give one its own data-track-index; the mix does not change",
|
||||
);
|
||||
});
|
||||
|
||||
it("stays quiet when one of the overlapping videos is muted", async () => {
|
||||
const codes = await codesFor(
|
||||
composition(video('data-has-audio="true"', 0) + video("muted", 2)),
|
||||
|
||||
@@ -929,8 +929,9 @@ function lintDuplicateAudioTracks(projectDir: string, rootHtml: string): Hyperfr
|
||||
findings.push({
|
||||
code: "duplicate_audio_track",
|
||||
severity: "warning",
|
||||
message: `Multiple audible <audio>/<video> elements on track ${a.trackIndex} overlap (${a.src} at ${formatSeconds(a.start)}-${formatSeconds(a.end)}s, ${b.src} at ${formatSeconds(b.start)}-${formatSeconds(b.end)}s). This causes layered audio playback.`,
|
||||
fixHint: "Use non-overlapping time windows or different track indices.",
|
||||
message: `Audible clips overlap on Studio track ${a.trackIndex}: ${a.src} at ${formatSeconds(a.start)}-${formatSeconds(a.end)}s and ${b.src} at ${formatSeconds(b.start)}-${formatSeconds(b.end)}s. Both play at once whatever their track (the render mixes every audible clip; data-track-index only picks the Studio lane), and Studio draws them over each other in that lane.`,
|
||||
fixHint:
|
||||
"If both should sound (a whoosh into a hit), give one its own data-track-index; the mix does not change. If one is a leftover duplicate, remove it or move it so the windows do not overlap.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user