import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.calls.speak(
    call_uuid='3a2e4c90-dcee-4931-8a59-f123ab507e60',
    text='Hello World', )
print(response)
{
  "message": "speak started",
  "api_id": "07abfd94-58c0-11e1-86da-adf28403fe48"
}

This endpoint lets you speak text in an active call.

API Endpoint

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

Arguments

ParameterTypeRequiredDescription
textstringYesThe text that needs to be spoken.
voicestringNoThe voice in which the text should be spoken.
Allowed values: MAN, WOMAN.
Defaults to WOMAN.
languagestringNoThe language used to speak the text.
Default: en-US (US English).
legsstringNoThe call leg in which the text is to be spoken.
Allowed values: aleg, bleg, both.
Defaults to aleg.
loopbooleanNoIf true, the text will be spoken repeatedly unless stopped.
Defaults to false.
mixbooleanNoControls audio mixing behavior.
If false, participants cannot hear others while text is being spoken.
If true, call audio and spoken text are mixed.
Defaults to true.

List of languages supported

LanguageCodeAvailable Voices
ArabicarbOnly WOMAN
Chinese Mandarincmn-CNOnly WOMAN
Danish (Denmark)da-DKWOMAN, MAN
Dutch (Netherlands)nl-NLWOMAN, MAN
English (Australia)en-AUWOMAN, MAN
English (India)en-INOnly WOMAN
English (UK)en-GBWOMAN, MAN
English (US)en-USWOMAN, MAN
English (Welsh)en-GB-WLSOnly MAN
French (Canada)fr-CAOnly WOMAN
French (France)fr-FRWOMAN, MAN
German (Germany)de-DEWOMAN, MAN
Hindi (India)hi-INOnly WOMAN
Icelandic (Iceland)is-ISWOMAN, MAN
Italian (Italy)it-ITWOMAN, MAN
Japanese (Japan)ja-JPWOMAN, MAN
Korean (South Korea)ko-KROnly WOMAN
Norwegian (Norway)nb-NOOnly WOMAN
Polish (Poland)pl-PLWOMAN, MAN
Portuguese (Brazil)pt-BRWOMAN, MAN
Portuguese (Portugal)pt-PTWOMAN, MAN
Romanian (Romania)ro-ROOnly WOMAN
Russian (Russia)ru-RUWOMAN, MAN
Spanish (Mexico)es-MXOnly WOMAN
Spanish (Spain)es-ESWOMAN, MAN
Spanish (US)es-USWOMAN, MAN
Swedish (Sweden)sv-SEOnly WOMAN
Turkish (Turkey)tr-TROnly WOMAN
Welsh (Wales)cy-GBOnly WOMAN

Returns

If successful, this endpoint returns an acknowledgement that the written text is being spoken in the call

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.calls.speak(
    call_uuid='3a2e4c90-dcee-4931-8a59-f123ab507e60',
    text='Hello World', )
print(response)
{
  "message": "speak started",
  "api_id": "07abfd94-58c0-11e1-86da-adf28403fe48"
}