Concept
AVOICE: block sits under a RESPOND. It changes how that one reply is spoken. The reply text and the transcript stay the same.
You can write a VOICE: block under:
- A
RESPONDin a FLOW step. - A
RESPONDinON_START. - A
RESPONDin aCOMPLETEcondition. - A named template.
VOICE: block. For them, set voice defaults for the whole call. See Set voice defaults for the whole call.
Which engine reads which key
The result depends on your voice mode and your text-to-speech provider. Pipeline voice means speech-to-text, agent, then text-to-speech. Realtime voice means speech-to-speech.
Microsoft Speech is the only provider that plays SSML in pipeline voice. The older Azure option uses the same engine and also plays SSML. Google, Amazon Polly, and ElevenLabs get the plain version.
Decide by what you need:
SSML rules
- The value must start with a
<speak>tag. A value that starts with other text is spoken as plain text. The compiler gives no message. - Always add
plain_text. Every provider except Microsoft Speech speaks it. - A
{{variable}}inssmlis escaped, so a name such asTom & Jerrycannot break the markup. A{{variable}}inplain_textis not escaped. - A reply that plays SSML is sent as one message, not streamed. Audio starts after the whole reply is ready.
- The platform does not check SSML structure. Test every SSML reply on a call.
- Tags such as
mstts:express-asneed a Microsoft voice that supports them.
Minimal working example
A booking agent collects a reference and a date. It then confirms both. The reference is read one character at a time.agents/booking-confirmation.agent.abl
booking_refandcheck_inareGATHERfields. The caller supplies both.check_inis adatefield, so it holds an ISO date such as2026-12-15. Thedateformat insay-asexpects this shape.
plain_text. The platform turns the ISO date in plain_text into “15 December 2026”.
How it works
- The platform fills in the
{{variables}}. Values inssmlare escaped for XML. - The platform checks that
ssmlstarts with<speak. If it does not, the reply is spoken as plain text. - On Microsoft Speech, the SSML is played as one buffered message. Otherwise the platform speaks
plain_text, or the reply text with markup removed. - If the reply sets
provider,voice_id,speed, ortemperature, the platform checks them against the call’s text-to-speech setup. It applies what it can. It skips the rest.
Per-reply voice settings
A reply can switch provider only when that provider is already part of the call. That means the channel’s text-to-speech provider, or a provider in the channel’s language voice setup. If the check fails, the platform ignoresprovider, voice_id, speed, and temperature for that reply. The call continues with its normal voice. The trace records the reason, such as unsupported_provider, unsupported_speed, or unsupported_temperature.
A reply with any applied voice setting is sent as one buffered message. Audio starts later than with a streamed reply.
pace is another name for speed. If a reply sets both, speed wins. If you set neither, the channel’s voice settings apply.
Realistic example
A delivery agent targets Microsoft Speech and ElevenLabs channels with one file. Each provider reads the keys it supports and ignores the others.agents/delivery-update.agent.abl
tracking_codeanddelivery_dateareGATHERfields. The caller supplies both.- The call-level
speed: 0.95applies to every reply that sets no speed of its own.
Common variations
Set voice defaults for the whole call
EXECUTION.voice sets the voice for the whole call. It works for generated replies too. It takes priority over the channel’s voice settings.
elevenlabs and your-voice-id are project-local values. Use a provider and voice that are set up in your project’s voice settings.
The platform reads these settings when the call connects. A speed or temperature that the provider does not support is ignored.
Change the voice for one reply
Set the keys next to the reply. The provider must already be part of the call.your-slow-voice-id is a project-local voice. access_code must be a collected field or another session value. Use lowercase or uppercase keys. Both work.
Switch voices by behavior profile
A behavior profile can carry the same keys. The platform applies them when the call connects and the profileWHEN matches the channel.
behavior_profiles/voice_slow.behavior_profile.abl
Reuse one spoken version in a template
Put theVOICE: block in a template. Every reply that uses the template speaks the same way.
TEMPLATE(name) value in SSML or PLAIN_TEXT must name a template that exists. The compiler rejects an unknown name.
Match the voice to the caller’s language
auto_tts_language_switch: true switches the voice to match the language of the reply. Set up voices for each language on the voice channel first. See Configure speaking style, tone, and pace.
Verification
- Call a Microsoft Speech channel. Listen for the pause, the slow code, and the date read as a date.
- Call an ElevenLabs channel with the same agent. The reply must speak
plain_text. It must not read any tag aloud. - In the call transcript, check that the text matches
plain_textor the reply text. It must show no markup. - For
provider,voice_id,speed, ortemperature, open the trace. Find thevoice_config_resolvedevent. Checksupported,appliedVoice,appliedSpeed, andunsupportedReasons. - Break one
ssmlvalue on purpose. Remove the<speak>tag. The reply must now be spoken as plain text.
Production readiness checklist
- Every
ssmlvalue has a matchingplain_textvalue. - Every SSML reply was tested on a real Microsoft Speech call.
- Every provider and voice ID named in
VOICE:is set up in the project. - Voice IDs and speeds are tested on each provider that you deploy.
- Latency was tested for replies that use SSML or per-reply voice settings. They are not streamed.
- A reviewer listened to the spelled-out codes and dates.