Objective
This article explains how to add a pause or delay before a Text-to-Speech message is read in an IVR built with Twilio Programmable Voice, using the TwiML <Pause> verb or the SSML <break> tag.
Product
Programmable Voice
Environment
Twilio Console
User Account Permission/Role(s) Required
An account user with permission to edit the TwiML application, TwiML Bin, or Studio Flow used by the phone number.
Procedure
Before choosing a method, confirm which Text-to-Speech voice the IVR uses. Basic voices (man, woman, and alice) do not support SSML, so only Method 1 applies to them. Standard, Neural, and Generative voices support both methods.
Method 1: Use the <Pause> verb (works with every voice)
- Open the TwiML Bin, TwiML application, or server-side code that returns the TwiML for the incoming call.
- Add a <Pause> element before the <Say> element that reads the message.
- Set the length attribute to the number of seconds of silence you want. The example below waits three seconds before the message is read:
<Response>
<Pause length="3"/>
<Say>Thanks for calling. Please listen to the following options.</Say>
</Response>- Keep <Pause> outside the <Say> element. It cannot be placed inside <Say>.
- Save the change and place a test call to confirm the timing.
Note: if <Pause> is the first element in the TwiML document, Twilio waits the specified number of seconds before answering the call. If the delay should happen after the call is answered, place another element before <Pause>, or use Method 2 instead.
Method 2: Use the SSML <break> tag inside the message
- Confirm that the <Say> element uses a Standard, Neural, or Generative voice. Basic voices ignore or reject SSML.
- Add a <break> tag at the beginning of the message text, inside the <Say> element.
- Set the time attribute to the length of the pause, in seconds or milliseconds:
<Response>
<Say voice="Polly.Joanna"><break time="3s"/>Thanks for calling.</Say>
</Response>- Do not add the SSML <speak> root element. Twilio adds it automatically, so only the inner SSML tags are needed inside <Say>.
- Save the change and place a test call to confirm that the message plays correctly with the selected voice.
Limits to keep in mind:
- With Amazon Polly voices, a single <break> can last at most 10 seconds (10s or 10000ms). For a longer delay, use several <break> tags or use Method 1.
- An SSML tag that the selected provider or voice does not support can cause the <Say> instruction to fail, so always test the exact voice in use.
- Commas and periods produce short natural pauses in synthesized speech, but their duration cannot be configured and they are not a substitute for <break> or <Pause>.