Skip to content
Twelve Studio
All posts
Engineering · · 6 min read

How we time captions to the exact spoken word

Captions in Twelve Studio highlight the word being said, not a guess. A look at the voice, alignment and snapping steps behind it.

By the TwelveAI team
How we time captions to the exact spoken word

Captions that drift from the voice are worse than no captions. Viewers notice within a second, and the video starts to feel cheap. So we decided early that caption timing would come from the audio itself, never from an estimate.

Step one: voice the line

Every narration line is voiced by an open-source text-to-speech model running on our own servers. The audio is trimmed of silence at the edges and levelled to a consistent loudness so scenes cut together cleanly.

Step two: listen to it

We then run speech recognition over the audio we just generated, with word-level timestamps turned on. That gives us, for each word the model heard, a start and an end time.

Step three: snap back to your text

Speech recognition is good, but it is not your script. It may spell a product name differently, merge two words, or hallucinate a stray word in a trailing silence. So we never show its words directly.

Instead we align its output against the original narration. Words that match take the recognised timing. Words it missed are spread evenly between their neighbours. Extra words it invented are dropped. What you see on screen is exactly what you wrote, timed to exactly what was said.

Pronunciation tokens

Some things should look one way and sound another. A price is the classic case:

Collections cost [₦2,500|two thousand five hundred naira] at most.

The voice reads the second half. The caption shows the first, as a single word, timed across the whole spoken phrase. The same works for URLs and abbreviations.

The result

Because timing is measured rather than guessed, the highlighted word is always the one being spoken, and scene lengths come from the real audio. Change a line and only that line is voiced again; everything else comes from a cache.

The preview in the editor estimates timing while you write. The render is exact.

Make your first launch video
Free plan, no card needed.
Create your first video
How we time captions to the exact spoken word | Twelve Studio