When making a Text-to-Speech callout, the synthesized voice starts speaking as soon as the call is answered. In some cases, this may not be desireable. Using Speech Synthesis Markup Language (or SSML), you can add a pause to the start of the speech so that the synthesized voice waits for a configurable period of time before speaking.
Note: To learn how to make a Text-to-Speech callout, see our getting started guides on our developer portal!
Adding a pause is as simple as adding a few SSML tags to the prompt property of the ttsCallout request body:
"endpoint": "<destination_phone_number>" },
"locale": "en-US", "prompts": "#ssml[<speak><break time="3s"/>Hello, this is a phone call from Sinch.</speak>]"
The above code will result in a 3-second pause before the synthesized voice says the prompt.
You can use SSML tags for many other things in Text-to-Speech calls. Sinch's Voice API supports the SSML tags defined in the RFC. Some of the available Voice IDs may have limited support of the defined SSML tags.