Skip to main content

Function: voiceoverToVTT()

voiceoverToVTT(cues): string

Defined in: src/a11y/captions.ts:110

Build a standards-valid WebVTT caption string from voiceover timings.

Each cue becomes a numbered WebVTT cue with an HH:MM:SS.mmm time range. An empty cue list still yields a valid file with just the WEBVTT header.

Parameters​

cues​

readonly VoiceoverCaptionCue[]

Returns​

string

Throws​

If any cue has a non-finite, negative, or non-increasing timestamp.