feat(dialogues): support multi-cue subtitles
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-30 04:00:25 +02:00
parent ce5dc8ada0
commit 02c1fb33d0
8 changed files with 192 additions and 53 deletions
+19 -1
View File
@@ -13,7 +13,8 @@ export interface DialogueDefinition {
id: string;
voice: DialogueVoiceId;
audio: string;
subtitleCueIndex: number;
subtitleCueIndex?: number;
subtitleCueIndices?: number[];
timecode?: number;
}
@@ -22,3 +23,20 @@ export interface DialogueManifest {
voices: DialogueVoice[];
dialogues: DialogueDefinition[];
}
export function getDialogueCueIndices(dialogue: DialogueDefinition): number[] {
if (dialogue.subtitleCueIndices && dialogue.subtitleCueIndices.length > 0) {
return dialogue.subtitleCueIndices;
}
if (dialogue.subtitleCueIndex !== undefined) {
return [dialogue.subtitleCueIndex];
}
return [];
}
export function getDialogueFirstCueIndex(
dialogue: DialogueDefinition,
): number | undefined {
const indices = getDialogueCueIndices(dialogue);
return indices[0];
}