Recipes

Narrate a story

Read a story in the storytelling style, with whispered and fearful moments.

Narrate in the storytelling style and change the delivery for single moments of the plot. Tags are covered in Emotion and speaking style.

Narrate in storytelling

Begin the story with [storytelling]. It applies until the next tag.

Mark the moments

Put [whisper] before the quiet line and [fearful] before the tense one, then go back to [storytelling]. Change only text in Play speech as it streams:

const text =
  "[storytelling] The old lighthouse keeper climbed the stairs one last time. " +
  "[whisper] Somewhere below, a door creaked open. " +
  "[fearful] He held his breath and listened. " +
  "[storytelling] It was only the wind, carrying the sound of the sea.";

for await (const chunk of client.synthesizeStream(text, {
  voice_id: voice.id,
  model: TtsModel.Nebula,
  timeoutSeconds: 30,
})) {
  process.stdout.write(chunk.audio);
}

To skip the switch back, wrap the moment instead: <emotion value="whisper">Somewhere below, a door creaked open.</emotion>. The narration resumes after the closing tag.

LanguageText sentListen
English[storytelling] The old lighthouse keeper climbed the stairs one last time. [whisper] Somewhere below, a door creaked open. [fearful] He held his breath and listened. [storytelling] It was only the wind, carrying the sound of the sea.
Arabic[storytelling] صعد حارس المنارة العجوز الدرج للمرة الأخيرة. [whisper] في مكان ما بالأسفل، صرّ باب وهو ينفتح. [fearful] حبس أنفاسه وأصغى. [storytelling] لم تكن سوى الريح، تحمل صوت البحر.

Send long stories in parts

Each request has a character limit, and a delivery doesn't carry over to the next request. Split a long story at paragraph breaks and begin every part with its tag.

Rules and limitations: Emotion and speaking style reference.

On this page