Skip to content

Commit eb98ff2

Browse files
wonjangcloud9claude
andcommitted
fix(lint): say the audio overlap warning is about a shared Studio lane
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 <[email protected]>
1 parent affa03b commit eb98ff2

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎docs/reference/lint-rules.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,9 +916,9 @@ Source: the project lint pass in `packages/lint/src/project.ts`, `packages/lint/
916916

917917
### `duplicate_audio_track`
918918

919-
**Warning.** Two audible elements overlap on the same track index, so their audio doubles up.
919+
**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.
920920

921-
**Fix:** Use non-overlapping time windows or different track indices.
921+
**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.
922922

923923
### `texture_mask_asset_not_found`
924924

‎packages/lint/src/project.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,23 @@ describe("audio-aware project rules", () => {
13071307
expect(codes).toContain("duplicate_audio_track");
13081308
});
13091309

1310+
it("says both clips still play, since the track index only picks the Studio lane", async () => {
1311+
const sfx = (id: string, start: string, duration: string) =>
1312+
`<audio id="${id}" src="${id}.wav" data-start="${start}" data-duration="${duration}" data-track-index="6"></audio>`;
1313+
const project = makeProject(
1314+
composition(sfx("whoosh", "5.13", "0.7") + sfx("land", "5.79", "0.34")),
1315+
);
1316+
const { results } = await lintProject(project);
1317+
const finding = results
1318+
.flatMap((result) => result.result.findings)
1319+
.find((f) => f.code === "duplicate_audio_track");
1320+
expect(finding?.message).toContain("whoosh.wav at 5.13-5.83s and land.wav at 5.79-6.13s");
1321+
expect(finding?.message).toContain("Both play at once whatever their track");
1322+
expect(finding?.fixHint).toContain(
1323+
"give one its own data-track-index; the mix does not change",
1324+
);
1325+
});
1326+
13101327
it("stays quiet when one of the overlapping videos is muted", async () => {
13111328
const codes = await codesFor(
13121329
composition(video('data-has-audio="true"', 0) + video("muted", 2)),

‎packages/lint/src/project.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,9 @@ function lintDuplicateAudioTracks(projectDir: string, rootHtml: string): Hyperfr
929929
findings.push({
930930
code: "duplicate_audio_track",
931931
severity: "warning",
932-
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.`,
933-
fixHint: "Use non-overlapping time windows or different track indices.",
932+
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.`,
933+
fixHint:
934+
"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.",
934935
});
935936
}
936937
}

0 commit comments

Comments
 (0)