Text to Speech in a Call
This guide covers how to use text to speech in your Android and iOS Vonage Client application. Before you begin, make sure you added the SDK to your app and (Android, iOS, JS) and you are able to make or receive calls.
Using Text to Speech in a Call
The Client SDK say function will play text provided. The say function can be passed just the text parameter and the default values for the other parameters will be used, or you can change the speech using the optional parameters. To learn more about the different parameters in the text to speech guide.
client.say(callID, "Hello World", callback: { error in
if error != nil {
// Handle say error
}
})
client.say(
callID,
"Hello World",
level: 0,
loop: 1,
queue: false,
language: "en-US",
ssml: false,
callback: { error in
if error != nil {
// Handle say error
}
}
)