Speak
The<Speak> element converts text to speech and plays it to the caller. Use it for dynamic messages that can’t be prerecorded.
Basic Usage
Speak Attributes
Change Voice and Language
Loop a Message
Play a message multiple times:loop="0" to repeat indefinitely until the call ends:
Supported Languages
SSML Support
Speech Synthesis Markup Language (SSML) provides fine-grained control over pronunciation, pitch, rate, and pauses. Use Polly voices for SSML support.Common SSML Tags
Speak Nesting
<Speak> can be nested inside:
<GetDigits>- Play message while collecting input<GetInput>- Play message while collecting speech/digits<PreAnswer>- Play message before answering
Play
The<Play> element plays an audio file to the caller. Use it for pre-recorded messages, music, or sound effects.
Basic Usage
Play Attributes
Loop Audio
Play hold music on repeat:Supported Formats
Requirements:
- Audio must be served over HTTPS
- Maximum file size: 10 MB
- Recommended: 8kHz or 16kHz sample rate, mono
Combine with Speak
Play During IVR
Nest<Play> inside <GetDigits> to play audio while collecting input:
Play Nesting
<Play> can be nested inside:
<GetDigits>- Play while collecting digits<GetInput>- Play while collecting speech/digits<PreAnswer>- Play before answering the call
Play Best Practices
- Use HTTPS - Audio URLs must use HTTPS
- Optimize file size - Compress audio for faster loading
- Host reliably - Use a CDN for audio file hosting
- Test audio quality - Ensure audio is clear at phone quality (8kHz)
- Provide fallback - Use
<Speak>as backup if audio fails to load
DTMF
The<DTMF> element sends DTMF (Dual-Tone Multi-Frequency) tones on the current call. Use it to navigate IVR systems, enter PINs, or interact with telephony systems.
Basic Usage
DTMF Attributes
Allowed Characters
With Pauses
Usew (0.5s) or W (1s) to add delays between tones:
Navigate External IVR
When dialing an external number with an IVR:sendDigits attribute on <Number> rather than the <DTMF> element.
Send During Call
Send tones during an active call:Synchronous vs Asynchronous
Async (default): DTMF sends while next element startsDTMF Use Cases
Combined with Dial
When using with<Dial>, prefer sendDigits on the <Number> element:
Related
- Input Collection - GetDigits, GetInput
- Call Routing - Dial, Redirect, Hangup, Wait
- SSML Concepts - Advanced speech control