The <Speak> element reads the text as speech to the caller. It is very useful for dynamic text that cannot be pre-recorded.

Element Attributes

The <Speak> element supports the following attributes that modify its behavior:

Attribute Name Allowed Values Default Value
engine cepstral, flite, tts_commandline flite
voice Check corresponding values for each engine. E.g. For flite: slt, rms, awb, kal slt
language As allowed by the engine en
loop integer >= 0 (0 indicates a continuous loop.) 1
type NUMBER, ITEMS, PERSONS, MESSAGES, CURRENCY, TIME_MEASUREMENT, CURRENT_DATE, CURRENT_TIME, CURRENT_DATE_TIME, TELEPHONE_NUMBER, TELEPHONE_EXTENSION, URL, IP_ADDRESS, EMAIL_ADDRESS, POSTAL_ADDRESS, ACCOUNT_NUMBER, NAME_SPELLED, NAME_PHONETIC, SHORT_DATE_TIME (Refer this) none
method PRONOUNCED, ITERATED, COUNTED (Refer this) none

Examples

Example 1: Hi this is Plivo

When a call is directed to the following RESTXML document, the caller will hear “Hi this is Plivo. I work on FreeSWITCH.” spoken once.

1
2
3
4
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Speak>Hi this is Plivo. I work on FreeSWITCH.</Speak>
</Response>

Example 2: Hey, Hey, Hey

This RESTXML document tells Plivo to say “Hey” thrice in a row.

1
2
3
4
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Speak loop="3">Hey</Speak>
</Response>

Comments are closed.