TTS Synthesis Markup Language
With the help of Speech Synthesis Markup Language (SSML), you can make your TTS responses seem more like natural speech. In the following Article you will find some examples of how to use it (applicable for both dynamic and static TTS).
The full List of SSML elements may be helpful for additional context and examples:
Created: May 2020
Permalink: https://wildix.atlassian.net/wiki/x/YwLOAQ
Do not use <speak> element as it is already hardcoded.
<break>
An optional element that you can use to insert pauses between words.
Attributes
Attribute | Description |
|---|---|
strength | Optional. Specify the relative duration of a pause using one of the following values:
|
time | Optional. Specify the absolute duration of a pause in seconds or milliseconds. Example: 2s and 500ms |
Syntax
<break />
<break strength="string" />
<break time="string" />Usage
Play sound -> Welcome to Wildix <break time="2s"/> Please wait for the next available operator
Example:
<prosody>
An optional element that specifies the pitch, contour, range, rate, duration, and volume for speaking the element's text.
Attributes
Attribute | Description |
|---|---|
pitch | Optional. Indicates the baseline pitch for the text. You may express the pitch as:
|
contour | Optional. Represents changes in pitch for speech content as an array of targets at specified time positions in the speech output. Each target is defined by sets of parameter pairs. For example: |
range | Optional. A value that represents the range of pitch for the text. You may express |
rate | Optional. Indicates the speaking rate of the text. You may express
|
duration | Optional. The period of time that should elapse while the TTS engine reads the text, in seconds or milliseconds. For example, 2s or 1800ms. |
volume | Optional. Indicates the volume level of the speaking voice. You may express the volume as:
|
Syntax
<prosody pitch="value" contour="value" range="value" rate="value" duration="value" volume="value"></prosody><say-as>
An optional element that indicates the content type (such as number or date) of the element's text.
Attributes
Attribute | Description |
|---|---|
interpret-as | Required. Indicates the content type of element's text. For a list of types, see the table below. |
format | Optional. Provides additional information about the precise formatting of the element's text for content types that may have ambiguous formats. SSML defines formats for content types that use them (see table below). |
detail | Optional. Indicates the level of detail to be spoken. For example, this attribute might request that the speech synthesis engine pronounce punctuation marks. There are no standard values defined for |
The following are the supported content types for the interpret-as and format attributes. Include the format attribute only if interpret-as is set to date and time.
interpret-as | format | Interpretation |
|---|---|---|
address |
| The text is spoken as an address:
|
cardinal, number |
| The text is spoken as a cardinal number: |
characters, spell-out |
| The text is spoken as individual letters (spelled out): |
date | dmy, mdy, ymd, ydm, ym, my, md, dm, d, m, y | The text is spoken as a date. The |
digits, number_digit |
| The text is spoken as a sequence of individual digits: |
fraction |
| The text is spoken as a fractional number: |
ordinal |
| The text is spoken as an ordinal number: |
telephone |
| The text is spoken as a telephone number. The |
time | hms12, hms24 | The text is spoken as a time. The |
Syntax
<say-as interpret-as="string" format="digit string" detail="string"> <say-as>Usage
The following example shows how to use the <break> element to pause between steps:
Dialplan application Play sound -> The person you're trying to reach isn't available <break time="2s"/> Please call back on <say-as interpret-as="date" format="dmy">12-05-2020</say-as> at <say-as interpret-as="time" format="hms12">4:00</say-as>
Example: