Speak

The Speak API allows a message to be played using Plivo’s text-to-speech engine. This API can be used to play spoken versions of text on live calls including emergency alerts, RSS feeds, live news updates, website content, etc. The languages and voice supported by this API are listed here. The Speak API also supports the ability to stop the text-to-speech audio that is being played on the call.

The following actions can be performed using the Speak API.

BaseURI: https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Speak/

Play Text During a Call

The Speak API lets you play text asynchronously on a live call. These notifications can be useful when played during a live call, for example: ‘Please hold, while we transfer your call’ or ‘Your balance is running low…’, etc.

POST https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Speak/

Arguments

Parameter Description Default
text (mandatory) The text to be played.
voice (optional) The voice to be used, can be MAN, WOMAN. WOMAN
language (optional) The language to be used, see Supported voices and languages below. en-US
legs (optional) The leg on which the text has to be played, can be aleg (i.e., A-leg is the first leg of the call or current call), bleg (i.e., B-leg is the second leg of the call),or both (i.e., both legs of the call). aleg
loop (optional) If set to true, the text will play indefinitely. false
mix (optional) If set to true, the text audio will be mixed in with current call audio. true

Response

HTTP Status Code: 202

{
  "message": "speak started",
  "api_id": "07abfd94-58c0-11e1-86da-adf28403fe48"
}

Supported Voices and Languages

Language Value WOMAN Voice MAN Voice
Danishda-DKyesno
Dutchnl-NLyesyes
English - Australianen-AUyesyes
English - Britishen-GByesyes
English - USAen-USyesyes
Frenchfr-FRyesyes
French - Canadianfr-CAyesno
Germande-DEyesyes
Italianit-ITyesyes
Polishpl-PLyesyes
Portuguesept-PTnoyes
Portuguese - Brazilianpt-BRyesyes
Russianru-RUyesno
Spanishes-ESyesyes
Spanish - USAes-USyesyes
Swedishsv-SEyesno

Stop Playing Text During a Call

You can asynchronously stop the text which is being played by the Speak API.

DELETE https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Speak/

Arguments

None

Response

HTTP Status Code: 202