The <Say> element reads text to the caller using a text-to-speech engine. <Say> is good to use with dynamic data, while <Play> may be a better choice for static information or prompts. The text to be read is nested within the <Say> element.
The attributes below can be used to change the <Say> behavior.
| Attribute | Description |
|---|---|
|
optional
|
The type of voice that will read the text to caller.
|
|
optional
|
Language used to speak the text.
|
|
optional
|
The amount of times the spoken text should be repeated. 0 indicates an infinite loop.
|
The language attribute allows you pick a voice with a specific language's accent and pronunciations. TelAPI currently supports English with an American accent (en), English with a British accent (en-gb), Spanish (es), French (fr), Italian (it), and German (de). The default is English with an American accent (en).
In addition to the default <Response> element, the <Say> element can also be nested within the <Gather> verb.
The <Say> element cannot nest any other elements within itself. It must only nest the text which will be read to the caller.
The InboundXML below will say "Hello" in a man's voice three times, "Hello, my name is Jane." in a womans voice one time, and then repeat "Now I will not stop talking." until the caller hangs up.
<Response>
<Say loop='3' voice='man'>Hello.</Say>
<Say voice='woman'>Hello, my name is Jane.</Say>
<Say loop='0'>Now I will not stop talking.</Say>
</Response>
Our helper libraries simplify the task of generating InboundXML while programming. The code below will output the above InboundXML example.