Besides the plain text input, it is possible to use Speech Synthesis Markup Language (SSML) in the input text for prompts in OCP miniApps®, thanks to the Omilia TTS engine.
The SSML of the TTS engine is based on the W3C SSML specification, however, not all the SSML elements and/or their attributes are supported. This document defines the SSML elements and the attributes that can be used.
Third-party TTS voice providers, supported in OCP platform, each offer their own SSML tag support available in their respective official documentations.
Note: There is not support on OCP for Google Chirp3-HD SSML tags, since they are Beta by google. Only volume/rate configurations in Orchestrator are supported for these voices.
The below SSML Tag support refers to Omilia TTS voices only.
Table of Supported SSML Elements in Omilia TTS voices
Here is a table containing the SSML elements that are currently supported:
|
Element |
Tag |
Usage |
|---|---|---|
|
|
Encapsulates SSML text |
|
|
|
Adds a pause in audio |
|
|
|
Provides control on how text should be pronounced or interpreted |
|
|
|
Specifies phonetic pronunciation |
|
|
|
Provides control on the speaking rate |
|
|
|
Replaces the text with its |
The lang element is accepted by the TTS Engine's SSML schema so that text containing it does not fail validation. No attributes or behavior of lang are currently supported or enforced — the xml:lang attribute is not acted on, and the encapsulated text is simply spoken using the request's normal voice and language settings. The use of the lang element is not necessary.
Note: <lang> is validated as well-formed SSML but does not change how any text inside it is verbalized or pronounced.
Description of SSML elements
speak
The speak element is the root element of SSML text. No attributes of speak are currently supported.
The use of the speak element is optional for the TTS engine, as it will be added in case it is missing. Note that generally this is not the case, because usually, it is a required element from other text-to-speech solutions.
Example
<speak>Hello world. How are you?</speak>
break
The break element is used to manually insert appropriate pauses or breaks in the speech output of the TTS Engine. The use of the break element is optional.
The <break> tag can take two attributes: time and strength. The time attribute specifies the duration of the pause in seconds or milliseconds, and the strength attribute specifies the relative strength of the pause. If no attributes are given, a medium strength pause (<break strength="medium"/>) will be assumed by default.
|
Attributes |
Description |
|---|---|
|
|
The duration of the break in seconds or milliseconds (e.g. "1.5s" or "300ms") |
|
|
The relative strength of the pause. Valid values are: |
Example
<speak>Let me think... <break time="0.8s"/> Ok... <break strength="medium"/> I think, I am ready</speak>
say-as
The say-as element is used to specify how text should be pronounced or interpreted in speech synthesis of TTS engine. The use of the say-as element is optional.
The <say-as> tag has a required attribute interpret-as, which is the main indicator of how the text should be verbalized. Currently, this is the only attribute supported.
|
Attributes |
Description |
|---|---|
|
|
Provides the main indication of how to verbalize the text |
|
|
Used in conjunction with some values of |
"interpret-as" values
You can check out the interpret-as values in detail below.
|
Value |
Description |
Example |
|---|---|---|
|
|
Both |
|
|
|
Both |
|
|
|
The |
|
|
|
The |
|
|
|
The |
|
|
|
The |
|
|
|
The |
|
|
|
The |
|
|
|
The |
|
phoneme
Use the <phoneme> tag to provide a phonetic pronunciation for specific words or phrases. This is useful for words with ambiguous pronunciation, proper names, or acronyms where standard pronunciation rules might fail.
The <phoneme> tag supports two attributes:
|
Attributes |
Description |
|---|---|
|
|
Specifies the phonetic alphabet to use. Supported values are |
|
|
Specifies the phonetic string that represents the pronunciation. |
IPA examples
The following examples demonstrate how to use the International Phonetic Alphabet (IPA):
This is <phoneme alphabet="ipa" ph="ˌmænɪˈtoʊbə">manitoba</phoneme>
This is <phoneme alphabet="ipa" ph="ˈpɑːpjəlɚ">popular</phoneme>
This is <phoneme alphabet="ipa" ph="ˈbʌbəl">bubble</phoneme>
This is <phoneme alphabet="ipa" ph="ˈkɹaʊn">crown</phoneme>
This is <phoneme alphabet="ipa" ph="ˈɡɹeɪvliː">gravely</phoneme>
This is <phoneme alphabet="ipa" ph="ˈmæpəŋ">mapping</phoneme>
This is <phoneme alphabet="ipa" ph="ˈliːʒɚ">leisure</phoneme>
This is <phoneme alphabet="ipa" ph="juːˈniːk">unique</phoneme>
This is <phoneme alphabet="ipa" ph="ˈtʃɔɪs">choice</phoneme>
This is <phoneme alphabet="ipa" ph="ˈvɪʒən">vision</phoneme>
This is <phoneme alphabet="ipa" ph="həˈloʊ">hello</phoneme>
This is <phoneme alphabet="ipa" ph="ˈbʌtər">butter</phoneme>
X-SAMPA examples
The following examples demonstrate how to use the Extended Speech Assessment Methods Phonetic Alphabet (X-SAMPA):
This is <phoneme alphabet="x-sampa" ph='m@"hA:g@%ni:'>mahogany</phoneme>
This is <phoneme alphabet="x-sampa" ph='"pApj@l@r'>popular</phoneme>
This is <phoneme alphabet="x-sampa" ph='bVb@l"'>bubble</phoneme>
This is <phoneme alphabet="x-sampa" ph='kr\\aUn"'>crown</phoneme>
This is <phoneme alphabet="x-sampa" ph='gr\\eIvli:"'>gravely</phoneme>
This is <phoneme alphabet="x-sampa" ph='m{p@N"'>mapping</phoneme>
This is <phoneme alphabet="x-sampa" ph='li:Z3r'>leisure</phoneme>
This is <phoneme alphabet="x-sampa" ph='ju:"ni:k'>unique</phoneme>
This is <phoneme alphabet="x-sampa" ph='tSOIs'>choice</phoneme>
This is <phoneme alphabet="x-sampa" ph='vIZ@n"'>vision</phoneme>
This is <phoneme alphabet="x-sampa" ph='h@"loU'>hello</phoneme>
This is <phoneme alphabet="x-sampa" ph='"bVt@'>butter</phoneme>
prosody
The prosody element is used to specify the speaking rate of the tagged text in speech synthesis of the TTS engine. The use of the prosody element is optional.
The <prosody> tag currently has attributes that control the rate and the volume of the speech, which are both optional.
|
Attributes |
Description |
|---|---|
|
|
Controls the rate of the speech |
|
|
Controls the volume of the speech |
"rate" values
You can check out the rate values in detail below.
|
Value |
Description |
Example |
|---|---|---|
|
|
The |
|
|
|
A set of constant values that affect the speech rate. Valid values are: |
|
"volume" values
You can check out the volume values in detail below.
|
Value |
Description |
Example |
|---|---|---|
|
|
The |
|
|
|
A set of constant values that control the speech volume. Valid values are: |
|
sub
The sub element replaces the text it encapsulates with the value of its alias attribute. Use it to control the spoken form of a word, for example a brand or place name whose spelling does not match its pronunciation. The use of the sub element is optional.
The <sub> tag has one required attribute, alias. Its value is the text that the engine speaks instead of the encapsulated text, which serves as a fallback for other voices.
|
Attributes |
Description |
|---|---|
|
|
The text that is spoken in place of the encapsulated text |
<sub> alias substitution applies only to Lexis voices. On other voices, the tag remains valid, but the engine ignores the alias and speaks the encapsulated text as written.
Keep aliases short: they are meant for a single word or a brand or place name. An alias longer than 200 characters is ignored, and the engine speaks the encapsulated text instead. An alias longer than 400 characters is invalid SSML, and the engine rejects it.
Example
<speak>Welcome to <sub alias="Akme">Acme</sub> Corporation.</speak>
-
On a Lexis voice, you hear "Welcome to Akme Corporation." The alias wins, and the engine never speaks "Acme."
-
On a non-Lexis voice, you hear "Welcome to Acme Corporation." The engine ignores the alias.
How <sub> combines with other tags
-
<sub>nests inside<speak>,<prosody>, and<lang>. These three elements are the only ones whose schema allows child SSML tags. -
<sub>cannot nest inside<say-as>,<phoneme>, or<break>. Their content models are text-only or empty, so a nested<sub>fails SSML validation. -
<sub>cannot contain other tags. Its content model is text-only, so<sub alias="Akme"><break time="200ms"/>Acme</sub>is invalid SSML.
Example
<speak>Please visit <prosody rate="slow"><sub alias="Akme">Acme</sub></prosody> today.</speak>
On a Lexis voice, this speaks "Akme" slowly. On a non-Lexis voice, it speaks "Acme" slowly. The engine ignores the alias but still applies prosody.