createCaptions
createCaptions<
M>(languagesMap):Captions<AllCaptions<M>>
Defined in: caption.ts:167
Creates a set of typed caption controllers, one per key in the map.
Each controller has start(), waitUntil(percent), and end().
At render time screenci sends the caption text to ElevenLabs, generates
a voiceover, and syncs the audio to the recording. You write text; the
voice is handled for you.
TypeScript enforces that every language has the same caption keys. Forget a translation key → compile error.
Type Parameters
Section titled “Type Parameters”M extends Partial<Record<"fi" | "en", { captions: Record<string, CaptionMapValue>; voice: VoiceKey; }>>
Parameters
Section titled “Parameters”languagesMap
Section titled “languagesMap”M & { [L in string | number | symbol]: { captions: AllCaptions<M>; voice: VoiceForLang<L & string> } }
Returns
Section titled “Returns”Captions<AllCaptions<M>>
Example
Section titled “Example”const captions = createCaptions({ en: { voice: voices.en.Jude, captions: { intro: 'Welcome.' } }, fi: { voice: voices.fi.Martti, captions: { intro: 'Tervetuloa.' } },})