/** * Ground-truth script alignment for Venice-generated content. * * When we already know the exact spoken text (from `ShotScript.vo` or a * TTS script), we can produce more accurate word timings than pure ASR by * mapping the script's canonical words onto whisper.cpp's detected word * timings via longest-common-subsequence alignment. * * The output is still a `WordTiming[]`, but the `word` field is the * script's canonical word (with correct capitalization / punctuation) * rather than whisper's best guess. Unmatched script words are linearly * interpolated between their neighbors. * * This matters in practice because TTS voices often produce subtle * mispronunciations or swallowed words that whisper transcribes as * homophones ("their" vs "there", "a" vs "uh"). For editing purposes * we want the script's words — that's what the captions, shot manifest, * and VO_TEXT array refer to. */ import type { WordTiming } from './types.js'; export interface AlignOptions { /** * How to treat script words that whisper didn't emit at all. With * `interpolate` (default), unmatched words are given proportional * timings between their aligned neighbors. With `drop`, they're * omitted entirely (useful for truncation detection). */ onMissing?: 'interpolate' | 'drop'; } /** * Align a ground-truth script against whisper word timings. */ export declare function alignScriptToWords(script: string, asrWords: WordTiming[], options?: AlignOptions): WordTiming[]; /** * Detect VO truncation: returns the portion of the script (if any) that * could not be aligned to ASR words because the audio ended before it. * Useful as a VO-truncation check (AGENTS.md anti-pattern, rule 26). */ export declare function detectTruncation(script: string, asrWords: WordTiming[]): { truncated: boolean; lostWords: string[]; lastAlignedSec: number; }; //# sourceMappingURL=aligner.d.ts.map