From 5073cd7398e3e8864856f250eec91807af17a423 Mon Sep 17 00:00:00 2001 From: Nick Beaugeard Date: Tue, 1 Sep 2026 13:21:47 +1000 Subject: [PATCH] fix: align exported subtitle highlights --- src/lib/videoExport.ts | 2 +- tests/videoExport.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/videoExport.ts b/src/lib/videoExport.ts index 9cf50eb..f3102a1 100644 --- a/src/lib/videoExport.ts +++ b/src/lib/videoExport.ts @@ -30,7 +30,7 @@ export interface VideoRenderRequest { const MIN_WORD_DURATION_MS = 90; const TYPICAL_WORD_DURATION_MS = 240; -const MODEL_RECOGNITION_DELAY_MS = 1_500; +const MODEL_RECOGNITION_DELAY_MS = 1_000; export const FINAL_CAPTION_HOLD_MS = 1_500; const MAX_LINE_WORDS = 8; const MAX_LINE_CHARACTERS = 48; diff --git a/tests/videoExport.test.ts b/tests/videoExport.test.ts index 77ca720..104a214 100644 --- a/tests/videoExport.test.ts +++ b/tests/videoExport.test.ts @@ -37,11 +37,11 @@ describe("video subtitle export", () => { expect(completed[3].endMs).toBeGreaterThan(completed[3].startMs); }); - it("compensates for the streaming model's transcript delay", () => { + it("compensates for the streaming model's one-second transcript delay", () => { const tokens = tokenizeScript("Make"); const timed = appendTimedScriptWords([], tokens, 0, 1, 2_500); - expect(timed).toEqual([{ text: "Make", startMs: 760, endMs: 1_000 }]); + expect(timed).toEqual([{ text: "Make", startMs: 1_260, endMs: 1_500 }]); }); it("groups a sentence into one lower-third line and finds its active word", () => {