TTS Settings Reference

A text-to-speech request is judged on three things: whether the voice sounds right for your application, whether the first audio arrives fast enough that callers do not notice the wait, and whether the audio plays cleanly on your telephony path. The settings in this article control all three. They let you choose the language, voice, and engine, shape the delivery, set the audio format and sample rate, and bound how long a synthesis may take. This reference lists every TTS setting in the gRPC API, with its type, default, range, and effect.

Before you start. Most TTS settings are supplied on the request that creates the interaction. The exceptions, voice mappings and logging, are inherited from the session or deployment and are covered below. How settings are inherited across levels is explained in Speech Settings: Hierarchy, Inheritance and Value Types. If you use MRCP instead of gRPC, see Mapping to MRCP settings.

Where TTS settings go

Where it is setSettings
On each TTS interaction (InteractionCreateTtsRequest)language, inline_request or ssml_request, audio_format, synthesis_timeout_ms, enable_partial_results, engine, general_interaction_settings
Deployment or session, inherited by interactionstts_settings (voice mappings), logging_settings, and the session settings

The audio format in particular is not configurable at the session or deployment level, because it is required explicitly on every interaction.

Interaction settings

These settings are part of the request that creates a TTS interaction.

SettingTypeDefaultRange or valuesDescription
languageStringNoneA language and country code, such as en-US or de-DEThe synthesis language for this request.
audio_formatMessageNone (required)See Audio formatThe audio format the synthesis generates. It is required on every interaction.
synthesis_timeout_msInteger5000MillisecondsLimits the maximum time allowed for a synthesis.
enable_partial_resultsBooleanfalsetrue, falseWhen true, partial results callbacks are enabled for the interaction, which speeds up the return of synthesis results.
engineEnumerationTTS_ENGINE_UNSPECIFIEDSee the table belowThe specific engine to use for this synthesis.
general_interaction_settingsMessageNoneSee belowSettings that apply to every interaction type.

Engines

Legacy and Neural TTS can run for the same language. By default, the platform routes a request to the engine that matches the voice you select. Set engine to override that routing.

ValueNumberMeaning
TTS_ENGINE_UNSPECIFIED0The default. Routes based on the installed CPU-based TTS, legacy or neural. The default is kept for backward compatibility.
TTS_ENGINE_NEURAL1Explicitly requests the Neural engine.
TTS_ENGINE_ION2Explicitly requests the Ion engine.

Partial results

With partial results enabled, partial results callbacks are delivered for the interaction, which speeds up the return of synthesis results. Enable it per interaction with enable_partial_results. The enable_partial_results field inside tts_settings is deprecated; use the interaction field instead.

General interaction settings

SettingTypeDefaultRange or valuesDescription
secure_contextBooleanfalsetrue, falseWhen true, certain ASR and TTS data is not logged. Wherever sensitive data would have been recorded, the log shows _SUPPRESSED instead. Enable it for prompts that speak account numbers, balances, or other sensitive values.
custom_interaction_dataStringNoneFree-formData you attach for your own external purposes. The platform does not use it.
logging_tagString (repeated)NoneFree-formReserved for future use.

Text to synthesize

Supply the text with either an inline request or an SSML URL request. The text can be plain text or SSML. For SSML elements and attributes, see Introduction to SSML.

Inline request

SettingTypeDefaultRange or valuesDescription
textStringNonePlain text or SSMLThe text to synthesize.
tts_inline_synthesis_settingsMessageNoneSee the table belowOptional voice and delivery settings for plain text.
ssl_verify_peerBooleantruetrue, falseVerifies the certificate of the peer on HTTPS requests, using a local certificate authority file. Set to false to skip verification for trusted sites.

SSML URL request

Use this when the SSML is hosted at a URL that the platform should fetch.

SettingTypeDefaultRange or valuesDescription
ssml_urlStringNoneA URLThe URL from which to fetch the SSML for the synthesis request.
ssl_verify_peerBooleantruetrue, falseVerifies the certificate of the peer on HTTPS requests, using a local certificate authority file. Set to false to skip verification for trusted sites.

Voice and delivery settings

These optional settings in tts_inline_synthesis_settings choose the voice and shape the delivery of plain text. Most values follow the W3C SSML standard, so you can also express them with SSML elements in the text itself.

SettingTypeDefaultRange or valuesDescription
voiceStringNoneA valid voice nameThe voice to use, if you are using plain text or the SSML does not specify one. See Neural TTS Languages for available voices.
synth_emphasis_levelStringNonestrong, moderate, none, reducedThe strength of the emphasis used in the voice.
synth_prosody_pitchStringNoneA number followed by Hz, a relative change, or x-low, low, medium, high, x-high, defaultThe pitch of the synthesized audio.
synth_prosody_contourStringNoneSee the SSML standard on pitch contourThe pitch contour of the synthesized audio.
synth_prosody_rateStringNoneA relative change, or x-slow, slow, medium, fast, x-fast, defaultThe speaking rate.
synth_prosody_durationStringNoneA time, such as 250ms or 3sHow long the synthesized text takes to play.
synth_prosody_volumeStringNoneA number, a relative change, or silent, x-soft, soft, medium, loud, x-loud, defaultThe volume of the synthesized audio.
synth_voice_ageStringNoneA non-negative integerThe age of the voice.
synth_voice_genderStringNoneneutral (uses the default), male, femaleThe gender to use if none is specified.

Audio format

The audio format is part of every TTS interaction request. Choose it to match what your telephony or media path can play.

SettingTypeDefaultRange or valuesDescription
standard_audio_formatEnumerationNone (required)See the table belowThe audio format to generate.
sample_rate_hertzInteger8000 (8 kHz)HertzThe sample rate of the audio. It is mandatory for raw PCM audio and optional for the other formats. For formats with headers, the value from the file header is used instead.
channel_countInteger1 (mono)Number of channelsSpecify it only for raw (headerless) multi-channel audio, such as stereo PCM or ULAW. For formats with headers, the file header value is used.

Neural voices are available for 24 kHz, 16 kHz, and 8 kHz synthesis. G.711 formats (ULAW and ALAW) are 8 kHz telephony formats.

ValueNumberDescription
STANDARD_AUDIO_FORMAT_LINEAR161Uncompressed 16-bit signed little-endian samples (linear PCM)
STANDARD_AUDIO_FORMAT_ULAW28-bit audio samples using G.711 PCMU (mu-law)
STANDARD_AUDIO_FORMAT_ALAW38-bit audio samples using G.711 PCMA (a-law)
STANDARD_AUDIO_FORMAT_WAV4WAV formatted audio
STANDARD_AUDIO_FORMAT_FLAC5FLAC formatted audio
STANDARD_AUDIO_FORMAT_MP36MP3 formatted audio
STANDARD_AUDIO_FORMAT_OPUS7OPUS formatted audio
STANDARD_AUDIO_FORMAT_M4A8M4A formatted audio
STANDARD_AUDIO_FORMAT_MP49Audio packed into an MP4 container
STANDARD_AUDIO_FORMAT_GSM10GSM audio
STANDARD_AUDIO_FORMAT_NO_AUDIO_RESOURCE100Explicitly indicates that no audio resource should be allocated

Not every standard format is supported in every case, because different operations natively handle a subset of the formats.

Voice mappings

Voice mappings let a request that names one voice be synthesized with another. The most common use is keeping existing applications working when you move to Neural voices: your SSML and MRCP requests keep their familiar voice names, and the mapping routes each name to the Neural voice you want, so you make no application changes. Mappings are part of the TTS settings, so they are inherited from the deployment or session rather than sent with each request.

SettingTypeDefaultRange or valuesDescription
voice_mappingsMapNoneKeyed by language, such as fr-CAA set of voice mappings for each language. The key is the language the mappings apply to.
voicePairsMap of stringsNoneVoice namesWithin a language, each key is the voice an application requests, and each value is the platform voice used for synthesis. Use the key default to set the default voice for the language.

In JSON, the structure looks like this. Note that the key is voicePairs in camel case. In this example, a request for Elodie in fr-CA is synthesized with Florence, and the default entry sets the default voice for fr-CA.

"ttsSettings": {
  "voiceMappings": {
    "fr-CA": {
      "voicePairs": {
        "Elodie": "Florence",
        "default": "Florence"
      }
    },
    "en-AU": {
      "voicePairs": {
        "Ian": "Leo",
        "default": "Leo"
      }
    }
  }
}

To see how speech settings are edited in a deployment, see Configuring Speech Settings Using the Management API.

Session and logging settings

Session settings (archiving, call and channel identifiers for call detail records, custom session data) and logging verbosity work the same way for TTS as for the other speech products. They are described in the ASR & Transcription Settings Reference.

Mapping to MRCP settings

MRCP clients configure comparable behavior through the [TTS] section of client_property.conf, which uses different names and, in some cases, different defaults and scales. Do not copy a value from one interface to the other without checking the table.

gRPC settingMRCP / client_property.conf nameDifference
languageSYNTHESIS_LANGUAGEMRCP default is en-US. In gRPC, specify the language on each request.
voiceSYNTH_VOICE_NAMESame meaning. If blank in MRCP, the first licensed voice is used.
synth_emphasis_levelSYNTH_EMPHASIS_LEVELSame values. MRCP default is moderate.
synth_prosody_pitchSYNTH_PROSODY_PITCHSame values. MRCP default is default.
synth_prosody_contourSYNTH_PROSODY_CONTOURSame values.
synth_prosody_rateSYNTH_PROSODY_RATESame values. MRCP default is default.
synth_prosody_durationSYNTH_PROSODY_DURATIONSame values.
synth_prosody_volumeSYNTH_PROSODY_VOLUMESame values. MRCP default is default.
synth_voice_ageSYNTH_VOICE_AGESame values.
synth_voice_genderSYNTH_VOICE_GENDERSame values. MRCP default is neutral.
synthesis_timeout_msTTS_REQUEST_TIMEOUTThe gRPC default is 5000 ms; the MRCP default is 10000 ms. The setting is the time to wait for synthesis to complete, not the length of the audio.
audio_format.standard_audio_formatSYNTHESIS_SOUND_FORMATgRPC offers the formats listed above; MRCP offers 1 = ULAW, 2 = PCM, 3 = ALAW, default 1.
audio_format.sample_rate_hertzSYNTHESIS_SAMPLING_RATEThe gRPC default is 8000. The MRCP article documents 8000 and 22050, with a default of 8000.
secure_contextSECURE_CONTEXT (in the [TTS] section)Both default to off.
enable_partial_resultsMEDIA_SERVER__ENABLE_TTS_PARTIAL_STREAMING (MRCP API server environment variable)Documented for MRCP in the release notes where partial results were introduced.

The MRCP client also has TTS properties with no gRPC counterpart: SYNTH_PROSODY_RANGE, SYNTH_VOICE_VARIANT, VISEME_GENERATION, TTS_SERVERS, and LOG_TTS_EVENTS. See Speech Client Configuration (client_property.conf).

Troubleshooting

SymptomLikely cause and fix
The request fails or the audio is unusableThe audio format is required on every interaction. Set standard_audio_format, and set sample_rate_hertz for raw PCM. Check that the format suits your telephony path (for example, 8 kHz for G.711).
Synthesis times out on long textThe default synthesis_timeout_ms is 5000 ms. Raise it for long prompts. Consider enable_partial_results to speed up the return of results.
Callers wait too long before hearing the promptEnable enable_partial_results on the interaction to speed up the return of synthesis results.
A voice name from an older application is not foundAdd a voice mapping that routes the old name to a platform voice, with a default entry for the language.
The wrong engine is usedWithout an explicit setting, routing follows the voice you select. Set engine to request Neural or Ion directly.
A default set in the portal does not change the audio format or timeoutThe audio format is required on each request, and the timeout is carried on the create request. Set them there.
Fetching SSML from an HTTPS URL failsssl_verify_peer is true by default, so the server certificate must be trusted. Fix the certificate chain, or set it to false only for trusted sites.
Sensitive text appears in logsSet secure_context to true for those interactions, so the text is replaced with _SUPPRESSED in the logs.

Related Articles


Was this article helpful?