Back
Nov 23, 2026

TTS Word Timestamps, Speech Marks, and Visemes: Captions and Lip-Sync Guide

TLDR: TTS word timestamps, often called speech marks or word alignment, attach a clock time to each spoken unit so captions, karaoke highlights, and avatar mouths stay locked to the audio. Amazon Polly returns line-delimited JSON with time in milliseconds and mark types sentence, word, viseme, and ssml. Inworld TTS-2 returns second-based word or character arrays plus phonemes and viseme symbols, with sync or async delivery on streams. This guide covers the formats, the failure modes, and how to keep timing portable when you change engines.

TTS word timestamps are timing metadata that pair each spoken token with a start and end position on the generated audio. The direct answer for production teams is to treat marks as a first-class deliverable next to the PCM or MP3 file, not as an optional debug field. Without them, subtitle tools guess, lip-sync engines drift, and a provider swap breaks every client that hard-coded one vendor schema.

What are TTS speech marks and word timestamps?

TTS speech marks are structured timing events emitted with or after synthesis so software can highlight words, draw captions, and drive mouth shapes. Amazon Polly documents four mark types: sentence, word, viseme, and ssml. Each object includes time in milliseconds from the start of the audio stream, byte offsets into the input text for word and sentence marks, and a value field that holds the text span, viseme name, or SSML tag.

Polly's own example for the phrase "Mary had a little lamb" emits a word mark for "had" at 373 ms with start byte 5 and end byte 8. That is the contract: milliseconds on the audio axis, bytes on the text axis. Polly also notes that the same input text can produce different metadata when you change the voice ID, so you cannot cache marks from one voice and reuse them on another without re-synthesis.

Modern neural APIs rename the same idea. Inworld's timestamp docs use timestampType set to WORD or CHARACTER. Word mode returns every token from the original text in order, including punctuation and whitespace, plus phoneticDetails with phone symbols and visemeSymbol values for animation. Character mode returns per-character start and end times in seconds.

Why do captions and lip-sync need TTS timestamps?

Captions and lip-sync need TTS timestamps because players and renderers cannot infer reliable word boundaries from raw waveform peaks alone. Karaoke-style UI needs per-word start times. Avatar faces need visemes, which group phones into mouth shapes rather than spelling. Agent UIs need aligned transcripts so the on-screen text does not lag the speaker.

LiveKit's agent text guide describes TTS-aligned transcripts and word-level synchronization when the selected TTS engine supports alignment. That is the product pattern: the transport layer expects timing, not just bytes. If your stack only stores the MP3, every caption pipeline becomes a post-hoc forced alignment job with its own error rate.

Visemes are the animation layer. Polly's speech marks include a dedicated viseme type. Inworld maps phones to symbols such as bmp for bilabials, fv for labiodentals, th for dental fricatives, and aei / o / ee for vowel families. Those symbols are not interchangeable across engines without a mapping table. Shipping Polly viseme names into an Inworld-trained rig is a silent desync bug.

How do provider timestamp formats differ?

Provider timestamp formats differ in units, granularity, transport, and whether phonemes ship with the words. Normalize early or every client forks.

CapabilityAmazon Polly speech marksInworld TTS-2 timestamps
Time unitMilliseconds from audio startSeconds (wordStartTimeSeconds)
Granularitysentence, word, viseme, ssmlWORD or CHARACTER
Text offsetsByte start/end on inputToken arrays that mirror input order
PhonemesVia viseme marks, not full phone listsphoneSymbol with duration per phone
StreamingSeparate speech-mark stream patternSYNC (audio+marks) or ASYNC (audio first)
Voice sensitivityMarks can change per voice IDAlignment available in supported languages

Inworld states that enabling timestamp alignment can increase latency, especially on the non-streaming endpoint. For streams, SYNC packs audio and timestamps in each chunk so live highlighting stays simple, at a small cost to first audio. ASYNC sends audio chunks first, then trailing timestamp messages, which protects time-to-first-audio when the UI can buffer marks a beat later.

That tradeoff is the production decision most teams skip. A course player that needs karaoke on first paint wants SYNC. A phone agent that must speak before the UI paints can prefer ASYNC and apply captions on the next frame.

What breaks when you switch TTS engines mid-product?

Switching TTS engines mid-product breaks timestamp clients that assume one schema, one unit system, and one viseme alphabet. Milliseconds become seconds. Byte offsets become token arrays. Viseme names change. Polly already warns that voice ID changes can rewrite mark timing for the same text. Cross-vendor swaps are a larger version of that warning.

Audio format mismatches compound the problem. Bland's 2026 sample-rate guide notes that telephony commonly needs 8 kHz mu-law while many neural engines natively render at 24 kHz or 48 kHz, and that OpenAI's classic /v1/audio/speech path publishes PCM at 24 kHz while phone mu-law often sits on a separate Realtime path. If you resample audio after marks are computed against the original clock, every caption drifts unless you transform the timeline with the same ratio.

Deprecation calendars make portability non-optional. OpenAI's deprecations page lists tts-1, tts-1-hd, and gpt-4o-mini-tts (including dated snapshots) as deprecated with a January 6, 2027 shutdown date and an October 1, 2026 notice date, pointing migrations toward Realtime mini models. Teams that baked one vendor's mark format into mobile clients will rebuild twice: once for audio transport, once for timing.

Also see the how-to switch TTS providers guide and TTS provider failover for the broader cutover checklist. Timestamps are the piece those migrations often leave for last.

How should you design a portable timestamp contract?

Design a portable timestamp contract as an internal schema your app owns, with adapters from each vendor. Store time in a single unit (prefer floating seconds with millisecond precision). Store text spans as Unicode character offsets or as stable token IDs, not raw vendor byte offsets alone. Map every viseme set into one animation alphabet your rigger supports.

A practical internal event looks like this in application code (illustrative):

type: word | sentence | viseme | silence
t_start_sec: 0.373
t_end_sec: 0.510
text: "had"
viseme: bmp
source_vendor: polly | inworld | other
source_voice: Joanna
audio_sha: ...

Rules that keep production sane:

  1. Re-emit marks whenever voice, model version, speaking rate, or SSML changes.
  2. Reject clips whose last word end time exceeds audio duration by more than a small epsilon.
  3. Fail closed when required mark types are missing for a channel (for example, visemes required for avatars).
  4. Keep pronunciation lexicons above the vendor so a brand name fix does not depend on one console.
  5. Log vendor, model, and mark schema version next to the audio object in object storage.

What TTS orchestration is is exactly this control plane: plan the request, call one or more engines, validate the audio and the timing package, retry, then ship.

Onepin is a voice workflow platform that orchestrates, validates, and ships production-ready audio across 100+ TTS models. Word timestamps and visemes become part of the delivery contract, not a vendor souvenir. When ElevenLabs, Amazon Polly, or Inworld change mark payloads, the adapter layer absorbs the change and your caption and lip-sync clients keep the same internal events.

If you only store waveforms today, add mark capture on the next release before the next deprecation email forces it. Docs: onepin.ai/docs.

Frequently asked questions

What are TTS word timestamps?
TTS word timestamps are timing metadata that pairs each spoken token with a start and end time on the audio stream. Teams use them for karaoke-style captions, word highlighting, and avatar lip-sync. Providers also call this speech marks or word alignment.
What is the difference between a word mark and a viseme?
A word mark points at text spans in the script. A viseme is a mouth-shape class used for animation, such as bilabial sounds grouped under one shape. You need both when captions and faces must stay locked to the same clip.
Do all TTS APIs return the same timestamp format?
No. Amazon Polly streams speech marks as line-delimited JSON with time in milliseconds. Inworld returns second-based word or character arrays plus phonetic details. LiveKit agents can consume TTS-aligned transcripts when the engine supports them. Always normalize into one internal schema.
Does enabling timestamps slow down streaming TTS?
It can. Inworld documents that timestamp alignment can increase latency, especially on non-streaming endpoints. Its async transport sends audio first and timestamps later so time-to-first-audio stays low. Sync mode keeps audio and marks in the same chunk for live highlighting.
How does Onepin help with TTS timestamps across providers?
Onepin is a voice workflow platform that orchestrates, validates, and ships production-ready audio across 100+ TTS models. It keeps pronunciation and delivery rules above the vendor so a mark schema change does not rewrite your caption or lip-sync clients. Failed clips still hit QA before they ship.

Ready to publish?

Turn any script into production-quality voice,
in any language, in minutes.

Run your first line