playTTS
playTTS
- playTTS(
params):Promise<CallPlayback>
Plays text-to-speech.
Parameters
params
Object containing the parameters for playing text-to-speech.
text
Text to play. SSML may be entered as a string wrapped in <speak> tags. See our supported voices and languages documentation for usage and supported tags.
language
Language of the text in ISO 639-1 (language name) + ISO 3166 (country code). Supported languages can be found here.
gender
Gender of the voice.
voice
Voice to use (takes precedence over gender). Supported voices can be found here.
volume
Volume value between -40dB and +40dB where 0 is unchanged.
Returns
Promise<CallPlayback>
A promise that resolves to a CallPlayback object that you can use to
view the current state and results of the play session.
Examples
In this example, we dial a phone number and play a TTS message. Once the TTS message is finished playing, we hangup the call.
In this example, we are using SSML to play a TTS message. Once the TTS message is finished playing, we hangup the call.