Skip to content

createNarration

createNarration<M>(input): Cues<AllCues<M>>

Defined in: cue.ts:393

Creates a set of typed narration controllers, one per key in the map.

Each cue is callable, and also has explicit start() and end() methods. At render time screenci generates narration, and syncs the audio to the recording. You write text; the voice is handled for you.

The top-level voice applies to all languages. Override it per-language via the voice field inside each language entry. Only language-level overrides may set seed.

TypeScript enforces that every language has the same cue keys. Forget a translation key → compile error.

M extends Partial<Record<"or" | "ar" | "bn" | "nl" | "en" | "fr" | "de" | "hi" | "id" | "it" | "ja" | "ko" | "mr" | "pl" | "pt" | "ro" | "ru" | "es" | "ta" | "te" | "th" | "tr" | "uk" | "vi" | "af" | "sq" | "am" | "hy" | "az" | "eu" | "be" | "bg" | "my" | "ca" | "ceb" | "cmn" | "hr" | "cs" | "da" | "et" | "fil" | "fi" | "gl" | "ka" | "el" | "gu" | "ht" | "he" | "hu" | "is" | "jv" | "kn" | "kok" | "lo" | "la" | "lv" | "lt" | "lb" | "mk" | "mai" | "mg" | "ms" | "ml" | "mn" | "ne" | "nb" | "nn" | "ps" | "fa" | "pa" | "sr" | "sd" | "si" | "sk" | "sl" | "sw" | "sv" | "ur", NarrationLanguageInput>>

NarrationInput<M>

Cues<AllCues<M>>

const narration = createNarration({
voice: { name: voices.Ava },
en: { intro: 'Welcome.', next: 'Click here.' },
fi: {
voice: { name: voices.Nora, seed: 42 },
intro: 'Tervetuloa.',
next: 'Napsauta tästä.',
},
})
// Start a narration segment directly:
await narration.intro.start()
await page.goto('/dashboard')
// Consecutive narration segments sequence automatically:
await narration.intro.start()
await narration.next.start() // ends intro, then starts next
// Run a line completely before the next action:
await narration.intro()
await page.click('#start')