Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Picking a voice


Learn to configure text-to-speech (TTS) voices for Twilio Conversation Relay by setting the ttsProvider and voice attributes in your TwiML. To do this, pick a provider, select a voice ID from the available inventory, and specify it within your <ConversationRelay> configuration. You can use this guide to create AI agents and AI/ML transcription.

See Related reference documentation to learn more about the <ConversationRelay> and TwiML elements used in this guide.

(information)

Info

If your workflow is subject to PCI, not all TTS and transcription providers are guaranteed to be PCI compliant. See Twilio's Responsibility Matrix(link takes you to an external page) for further information.

All Conversation Relay guides


SSML support by provider

ssml-support-by-provider page anchor

Support for Speech Synthesis Markup Language (SSML) tags varies by TTS provider in Conversation Relay:

  • Google and Amazon Polly: These engines support a wide range of SSML tags. To review a complete list of supported tags, see the SSML documentation.
  • ElevenLabs: ElevenLabs v3 and v4 don't support SSML. Use audio tags instead. Earlier ElevenLabs models support only the <phoneme> tag, and only for the en-US language. See the ElevenLabs documentation(link takes you to an external page) for details.

Google and Amazon Polly voices

google-and-amazon-polly-voices page anchor

For voices from Google or Amazon (including generative options), refer to our Twilio TTS Voices documentation. Each provider offers a variety of languages and styles, enabling you to tailor your application's voice experience to your specific needs.

How to use Google and Amazon Polly voices

how-to-use-google-and-amazon-polly-voices page anchor
  1. Browse the available voices in the Available voices and languages table. Test them using the Twilio Console to find the one that best fits your application's requirements.
  2. Copy the voice ID from the table (for example, en-US-Wavenet-D).
  3. Configure the <ConversationRelay> noun in TwiML: Set ttsProvider to Google or Amazon and use the copied voice ID in the voice attribute.

Conversation Relay supports ElevenLabs v3 and v4 text-to-speech models, which produce expressive, emotionally adaptive speech. We recommend ElevenLabs v4. Compared with earlier models, v4 reduces median inference latency to about 100ms for faster turn-taking, supports 90+ languages with native accents, and needs less prompt engineering to sound natural.

Use the voice search tool on this page to search and filter through a wide selection of ElevenLabs voices by language, accent, age, and more. Each voice entry includes a voice ID that you can copy and paste into your <ConversationRelay> configuration.

How to use ElevenLabs voices

how-to-use-elevenlabs-voices page anchor
  1. Search or filter: Pick a voice using the search tool that matches your requirements.
  2. Copy the voice ID: From the search results, copy the voice ID (for example, 21m00Tcm4TlvDq8ikWAM).
  3. Configure the <ConversationRelay> noun: In your TwiML, set ttsProvider="ElevenLabs" and use the copied voice ID in the voice attribute.
  4. Select ElevenLabs v4 (recommended): Append -v4 to the voice ID. For example, 21m00Tcm4TlvDq8ikWAM-v4.
  5. Customize your voice (optional): Append stability and similarity values to the model, for example 21m00Tcm4TlvDq8ikWAM-v4-0.35_0.8. Give both values or neither. See Voice string format.

Example:

1
<Connect>
2
<ConversationRelay url="wss://example.com/websocket" ttsProvider="ElevenLabs" voice="21m00Tcm4TlvDq8ikWAM-v4" ... />
3
</Connect>

Choose an ElevenLabs model

choose-an-elevenlabs-model page anchor

Append a model to the voice ID with a hyphen. Use one of the values in the following table, without an eleven_ prefix.

ModelValues for the voice attribute
ElevenLabs v4 (recommended)<VOICE_ID>-v4 or <VOICE_ID>-v4_turbo
ElevenLabs v3<VOICE_ID>-v3 or <VOICE_ID>-v3_conversational
Earlier modelsSee Other ElevenLabs models

Conversation Relay reads the model and the voice settings from the voice attribute. Use the following format:

[Voice ID]-[Model]-[Speed]_[Stability]_[Similarity]

Use a hyphen between the voice ID, the model, and the settings. Use underscores between the individual setting values. Don't use hyphens and underscores interchangeably. Add the values in the following order. The settings are optional, but if you add them, give every value for the model: speed, stability, and similarity for earlier models, or stability and similarity for v3 and v4. Write each value with one or two decimal places, such as 0.5 or 0.35.

PositionParameterDescriptionSupported values
1Voice IDThe 20-character ElevenLabs voice ID. Required.For example, 21m00Tcm4TlvDq8ikWAM
2ModelThe ElevenLabs model. Optional.v4, v4_turbo, v3, v3_conversational, and earlier model IDs
3SpeedThe speech speed multiplier. Applies to earlier models only. For v3 and v4, omit it or set it to 1.0. Conversation Relay rejects any other value.0.7 to 1.2. The default is 1.0.
4StabilityHow consistent the voice is compared to how much its emotion varies. Required when you add settings.0.0 to 1.0
5SimilarityHow closely the output matches the original voice. Required when you add settings.0.0 to 1.0

The following examples show valid voice values for v4:

  • 21m00Tcm4TlvDq8ikWAM-v4: v4 with the default stability and similarity.
  • 21m00Tcm4TlvDq8ikWAM-v4-0.35_0.8: v4 with a stability of 0.35 and a similarity of 0.8. Lower stability gives the model more freedom to act on audio tags.
  • 21m00Tcm4TlvDq8ikWAM-v4-1.0_0.35_0.8: v4 with the four-value format. v3 and v4 don't support speed control, so the speed value must be 1.0. A different value, such as 1.2, is rejected.

Use audio tags with ElevenLabs v3 and v4

use-audio-tags-with-elevenlabs-v3-and-v4 page anchor

ElevenLabs v3 and v4 don't support SSML <break> tags or numeric speed controls. Instead, they use audio tags: natural-language directions in square brackets that you place inline in the text that you send to Conversation Relay. Because v3 and v4 share the same tag syntax, the tags and prompts that you write for v3 work with v4 without changes.

Include the tags directly in the token of the text tokens messages that you send to Conversation Relay:

1
{
2
"type": "text",
3
"token": "[whispering] Your confirmation number is on its way.",
4
"last": true
5
}

ElevenLabs doesn't define a fixed list of valid tags. The model interprets the text in the brackets. A single adjective such as [excited], a participle such as [whispering], or a short phrase such as [cautiously optimistic] works best. You can combine directions, for example [slow, low voice]. If the model doesn't recognize a tag, it ignores the tag and uses its default delivery, and the API doesn't return an error.

CategoryExample tagsExample text
Emotion and delivery[whispering], [excited], [sarcastic][whispering] I have a secret for you.
Non-verbal reactions[laughs], [sighs], [clears throat], [gasp][sighs] Let me check that account for you.
Pacing[fast], [briskly], [slowly], [unhurriedly][fast] Let me quickly read that back to you.

Follow these best practices:

  • Watch for changes in tone. Audio tags change pitch, emotion, and vocal weight, not only speed. Intense tags such as [rapid-fire] or [rushed] can make an agent sound anxious. For pacing, use tempo-focused tags such as [fast] or [briskly].
  • Don't end a response with a reset tag. Don't add [neutral] to the end of a string to reset the model. The model can speak the tag aloud, add breathy noises, or drop in pitch before it finishes.
  • Repeat tempo tags in each sentence. In streaming, the effect of a tag fades as the text continues. For responses with several sentences, add the tempo tag to each sentence instead of only the start of the response.
  • Use punctuation for pauses. Use commas, periods, and ellipses (...) to create natural pauses instead of SSML delay tags.

Move from SSML or numeric speed settings

move-from-ssml-or-numeric-speed-settings page anchor

If you upgrade an application from an earlier ElevenLabs model, make the following changes:

  • Remove SSML <break> tags from your text.
  • Replace speed adjustments with pacing tags, or choose a voice whose natural pace matches your application. Each ElevenLabs voice has its own pace. v3 and v4 don't support the speed setting, and Conversation Relay rejects a v3 or v4 voice string with a speed other than 1.0. Remove the speed value from the voice string, or set it to 1.0.

If you don't specify a model, ElevenLabs voices use the Flash 2.5 model(link takes you to an external page) by default, except for en-US, which uses Flash 2 (flash_v2). Other models are available and could improve the quality or performance of your application depending on your use case.

To use one of these models, append a hyphen to the voice ID followed by the model ID. The supported model IDs include flash_v2, turbo_v2_5, turbo_v2, and the defaults, flash_v2_5 and flash_v2 (for en-US). Some models only work with a specific set of languages. You can learn about the strengths and the supported languages of each model on the ElevenLabs website(link takes you to an external page).

With these models, you can also adjust the speed and other characteristics of your voice. Add a hyphen to the end of the voice attribute followed by an underscore-separated string with values for speed, stability, and similarity respectively. The speed should be a value between 0.7 and 1.2, and the stability and similarity values can range from 0.0 to 1.0.

For example, a voice attribute of XrExE9yKIg1WjnnlVkGX-1.2_0.6_0.8 sets the speed to 1.2, the stability to 0.6, and the similarity to 0.8. See the ElevenLabs documentation(link takes you to an external page) to learn more about how these settings affect your application's voice.

Example:

1
<Connect>
2
<ConversationRelay url="wss://example.com/websocket" ttsProvider="ElevenLabs" voice="NYC9WEgkq1u4jiqBseQ9-turbo_v2_5-0.8_0.8_0.6" ... />
3
</Connect>

For SSML, earlier ElevenLabs models support only the <phoneme> tag, and only for the en-US language. See SSML support by provider.


If you don't explicitly specify the voice attribute in your <ConversationRelay> configuration, Conversation Relay automatically applies a default voice based on the language setting (as defined by the language or ttsLanguage attribute) and the selected TTS provider (default is ElevenLabs). The following table lists the default voice settings for the languages that have them. For other languages, ElevenLabs uses the voice UgBBYS2sOqTuMpoF3BR0:

LanguageVoice IDTTS providerSpeech modelTranscription provider
multiygiXC2Oa1BiHksD3WkJZElevenLabsnova-3-generalDeepgram
bg-BGAB9XsbSA4eLG12t2myjNElevenLabsnova-3-generalDeepgram
cs-CZuYFJyGaibp4N2VwYQshkElevenLabsnova-3-generalDeepgram
da-DKygiXC2Oa1BiHksD3WkJZElevenLabsnova-3-generalDeepgram
de-DEFTNCalFNG5bRnkkaP5UgElevenLabsnova-3-generalDeepgram
en-AU9Ft9sm9dzvprPILZmLJlElevenLabsnova-3-generalDeepgram
en-GBFahco4VZzobUeiPqni1SElevenLabsnova-3-generalDeepgram
en-INmCQMfsqGDT6IDkEKR20aElevenLabsnova-3-generalDeepgram
en-USUgBBYS2sOqTuMpoF3BR0ElevenLabsnova-3-generalDeepgram
es-ES6xftrpatV0jGmFHxDjUvElevenLabsnova-3-generalDeepgram
es-USuDhfdG2VwEjWZ4JYzggnElevenLabsnova-3-generalDeepgram
fi-FI6xPz2opT0y5qtoRh1U1YElevenLabsnova-3-generalDeepgram
fr-CAIPgYtHTNLjC7Bq7IPHrmElevenLabsnova-3-generalDeepgram
fr-FRa5n9pJUnAhX4fn7lx3uoElevenLabsnova-3-generalDeepgram
hi-INIvLWq57RKibBrqZGpQrCElevenLabsnova-3-generalDeepgram
hu-HUTumdjBNWanlT3ysvclWhElevenLabsnova-3-generalDeepgram
id-ID1k39YpzqXZn52BgyLyGOElevenLabsnova-3-generalDeepgram
it-ITuScy1bXtKz8vPzfdFsFwElevenLabsnova-3-generalDeepgram
ja-JP3JDquces8E8bkmvbh6BcElevenLabsnova-3-generalDeepgram
kn-INkn-IN-Standard-AGooglelongGoogle
ko-KRuyVNoMrnUku1dZyVEXwDElevenLabsnova-3-generalDeepgram
ml-INml-IN-Standard-AGooglelongGoogle
mr-INmr-IN-Standard-AGooglelongGoogle
nl-BEs7Z6uboUuE4Nd8Q2nye6ElevenLabsnova-3-generalDeepgram
nl-NLUNBIyLbtFB9k7FKW8wJvElevenLabsnova-3-generalDeepgram
pl-PLW0sqKm1Sfw1EzlCH14FQElevenLabsnova-3-generalDeepgram
pt-BRCstacWqMhJQlnfLPxRG4ElevenLabsnova-3-generalDeepgram
pt-PTpt-PT-Standard-AGooglenova-3-generalDeepgram
ro-ROOlBp4oyr3FBAGEAtJOnUElevenLabsnova-3-generalDeepgram
ru-RUAB9XsbSA4eLG12t2myjNElevenLabsnova-3-generalDeepgram
sv-SE4xkUqaR9MYOJHoaC1NakElevenLabsnova-3-generalDeepgram
ta-INZhJ5LanYnCmLKQUXvsV7ElevenLabslongGoogle
te-INte-IN-Standard-AGooglelongGoogle
th-THth-TH-Standard-AGooglenova-2-generalDeepgram
tr-TRIuRRIAcbQK5AQk1XevPjElevenLabsnova-3-generalDeepgram
uk-UAnCqaTnIbLdME87OuQaZYElevenLabsnova-3-generalDeepgram
vi-VNfoH7s9fX31wFFH2yqrFaElevenLabsnova-3-generalDeepgram

Unless you specify a model, ElevenLabs voices use Flash 2 for en-US and Flash 2.5 for other languages. To use ElevenLabs v4, append -v4 to the voice ID. Our internal configuration defines these default settings and updates them periodically. Refer to the Twilio TTS voices documentation for a complete and current list of supported languages, default voices, and detailed settings.


Use cases for picking a voice with Conversation Relay

use-cases-for-picking-a-voice-with-conversation-relay page anchor

This guide teaches the basics required for the following use cases:

Create AI agents with Twilio Conversation Relay

create-ai-agents-with-twilio-conversation-relay page anchor

You can use this guide to select natural-sounding, low-latency voices that enhance the realism of your autonomous AI agents. By choosing specific providers like ElevenLabs, you can tailor the personality and tone of your AI agent to better suit your brand's customer service experience.

To learn more advanced features that you can use with AI agents, see AI agents.

Create transcriptions for AI or ML with Twilio Conversation Relay

create-transcriptions-for-ai-or-ml-with-twilio-conversation-relay page anchor

You can use this guide to define the voice output for applications that simultaneously capture and transcribe audio for downstream machine learning analysis. Configuring the right TTS engine ensures that your application provides high-quality audio interactions while your system processes real-time data.

To learn more advanced features that you can use with AI or ML transcription, see Voice AI/ML transcription.


After following this guide, you can successfully configure and customize the text-to-speech voice for your Twilio Conversation Relay application. You can confirm it worked by making a test call to your application and verifying that the relay uses your selected provider and voice ID with the specific speed, stability, and similarity settings you defined.


Explore the following guide to build on what you've learned in this guide: