Recipes

Voice a support agent

Make a support reply sound sorry about the problem and warm at the goodbye.

Speak the call in the call_center style and switch to an emotion only for the sentences that need one. Tags are covered in Emotion and speaking style.

Start in call_center

Begin the reply with [call_center]. It applies until the next tag.

Tag the apology and the goodbye

Put [sad] before the apology and [happy] before the goodbye. Switch back to [call_center] after the apology, or the fix sounds sad too. Change only text in Play speech as it streams:

const text =
  "[call_center] Thank you for calling, this is Nourah. " +
  "[sad] I'm really sorry your card was blocked while you were travelling. " +
  "[call_center] I've unblocked it now, and you can use it right away. " +
  "[happy] Have a wonderful trip!";

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

Compare before and after

Voice mul_nourah. Tag names stay in English in Arabic text.

VersionText sentListen
Before (English)Thank you for calling, this is Nourah. I'm really sorry your card was blocked while you were travelling. I've unblocked it now, and you can use it right away. Have a wonderful trip!
After (English)[call_center] Thank you for calling, this is Nourah. [sad] I'm really sorry your card was blocked while you were travelling. [call_center] I've unblocked it now, and you can use it right away. [happy] Have a wonderful trip!
Before (Arabic)شكراً لاتصالك، معك نورة. يؤسفني جداً أن بطاقتك أُوقفت أثناء سفرك. لقد أعدت تفعيلها الآن ويمكنك استخدامها فوراً. أتمنى لك رحلة سعيدة!
After (Arabic)[call_center] شكراً لاتصالك، معك نورة. [sad] يؤسفني جداً أن بطاقتك أُوقفت أثناء سفرك. [call_center] لقد أعدت تفعيلها الآن ويمكنك استخدامها فوراً. [happy] أتمنى لك رحلة سعيدة!

Rules and limitations: Emotion and speaking style reference.

On this page