Skip to content

Measure subtitle pauses from the end of the preceding word - #2899

Open
justavibedev wants to merge 1 commit into
openai:mainfrom
justavibedev:fix/subtitle-pause-between-words
Open

justavibedev wants to merge 1 commit into
openai:mainfrom
justavibedev:fix/subtitle-pause-between-words

Conversation

@justavibedev

Copy link
Copy Markdown

When word timestamps, max_line_width, and max_line_count are enabled, the subtitle writer starts a new cue after a long pause. It currently subtracts the start times of consecutive words. A word from 0–1s followed by a word starting at 3.5s therefore triggers a break, even though the gap is only 2.5s and both words fit on one line.

Use the previous word's end to measure the gap. The existing threshold remains strictly greater than three seconds. This only changes how the SRT/VTT writers group already-timed words; it does not change the transcript or its timestamps.

#1184 describes the onset-based calculation as a workaround for stretched boundary words and points to the now-merged timing heuristic in #1114. The tradeoff is that if a predicted word end still extends into silence, the writer will use that end rather than infer an earlier pause.

I tested gaps below, at, and above the threshold. Two cases fail on main (8609812), and the genuine long-pause control passes. With the patch, all three pass; the selected writer, tokenizer, and normalizer tests total 11 passes. These are offline tests with synthetic timings, not an evaluation of alignment quality on real audio.

Developed and tested with Codex assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant