SSML Tags
SSML(Speech Synthesis Markup Language) is a powerful tool. At AudioStack, as a provider-agnostic service we recognise the importance of granular control over your content regardless or provider, and we have now harmonised the most used/important tags to help you tailor your content to the maximum. This means that you can use the same format of tag across multiple providers. If the change in question isn't supported by a particular provider, your code will still run.
Please note:
By using any of these SSML tags, the Voice Intelligence Layer is automatically set to
True
.
<as:break>
body = {
"scriptText": "<as:section> hello <as:break time="4s"/> worlds </as:section>",
}
You can specify a break in your script, with a duration of your choice. You must specify either the time of strength of the break:
Attribute | Required | Syntax | Description |
---|---|---|---|
time | Optional (must specify either time OR strength) | <as:break time="string" /> | The absolute duration of a pause in seconds or millisecond |
strength | Optional (must specify either time OR strength) | <as:break strength="string" /> | The relative duration of a pause by using one of the following values: β’ x-weak (equivalent to 120 ms) β’ weak (equivalent to 300 ms) β’ medium (equivalent to 500ms) β’ strong (equivalent to 700ms) β’ x-strong (equivalent to 900ms) |
The following providers do not support break tags:
Wellsaid, Openai, Playht
Examples
This a pause that lasts <as:break time="0.5s"/> half a second. It is equivalent to <break time="5000ms"/> this.
This is going to be a long <as:break strength="strong"/>pause.
<as: prosody>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
pitch | Optional (must specify at least one of the attributes) | <as:prosody pitch="string">some text </as:prosody> | This attribute indicates the baseline pitch for the text. Pitch is the relative highness or lowness of a tone as perceived by the ear.Can be specified by using: β’ A keyword: - default (baseline pitch for the current voice) - x-low - low - medium - high - x-highβ’ A percentage indicating a relative change: +/-n% |
rate | Optional (must specify at least one of the attributes) | <as:prosody rate="string">some text </as:prosody> | This attribute indicates the speaking rate of the voice (how fast/slow the voice talks). Can be specified by using: β’ A keyword: - default (baseline rate for the current voice) - x-slow - slow - medium - fast - x-fastβ’ A percentage indicating a non-negative change: n% For example, a value of 100% means no change in speech rate, a value of 200% means a speaking rate twice the default rate, and a value of 50% means a speaking rate of half the default rate. |
volume | Optional (must specify at least one of the attributes) | <as:prosody volume="string">some text</as:prosody> | Indicates the volume level of the speaking voice.Β Can be specified by using: β’. A keyword: - default (baseline volume for current voice) - silent - x-soft - soft - medium - loud - x-loud β’ A dB value indicating a relative change: +/-ndB |
Please Note:
- Polly voices donβt support pitch adaptions, Azure voices only support pitch changes at sentence level.
- IBM voices donβt support volume adaptions. Azure voices only support volume changes at the sentence level and if the closing tag is located at the end of the text.
The following providers do not support prosody tags:
Elevenlabs, Wellsaid, Openai, Playht, Cerevoice, Messner
Examples
<as:prosody pitch="-50%">This is a sentence with reduced pitch </as: prosody>
This sentence is normal. <as:prosody pitch="x-high"> while this one is high-pitched </as:prosody>
<as:prosody rate="150%" volume="+6dB">This is a sentence which is 1.5 times faster than the baseline and is produced at approximately twice the current volume</as:prosody>
<as:spell-out>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
characters | Optional (must specify at least one of the attributes) | <as:spellout characters="some text"/> | This attribute specifies if the content to be spelled out is characters or digits |
digits | Optional (must specify at least one of the attributes) | <as:spell-out digits=" some number"/> | This attribute specifies if the content to be spelled out is characters or digits |
Examples
Input | Output |
---|---|
Check the <as:spell-out characters="FAQ"/> section on our website. |
Check the <as:spell-out characters="FAQ"/> section on our website.
My PIN is <as:spell-out digits="7590"/>.
<as:ordinal>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
number | Required | <as:ordinal number="some number"/> | The number to be spelled out as ordinal |
ending | Optional | <as:ordinal number="some number" ending="valid ending"/> | Only relevant for German, Spanish and Italian. Specifies the suffix of the ordinal. β’. Valid values for German: - βeβ (default) - βenβ - βemβ - βesβ - βerβ β’. Valid values for Italian: - βoβ (default) - βaβ β’. Valid values for Spanish: - ββ (default) - βoβ - βaβ |
βοΈThis feature is supported in the following languages: EN, FR, IT, DE, ES
Examples
She won the <as:ordinal number='1st'/> place in the competition.
El <as:ordinal number='101'/> episodio del programa fue una celebraciΓ³n especial.
<as:ordinal number='10' ending="es"/> Jahr nach der EinfΓΌhrung: eine Bilanz.
<as:telephone>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
numbers | Required | <as:telephone number="some number"/> | The number will be pronounced as telephone number |
Examples
My phone number is <as:telephone number="555 536269"/>
<as:date>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
day | Required | <as:date day="integer" month=""integer/> | Calendar day in numeric format; valid values: integers from 1-31 |
month | Required | <as:date day="integer" month=""integer/> | Month in numeric format; valid values: integers from 1-12 |
year | Optional | <as:date day="integer" month="integer" year="integer"/> | Year in numeric format |
format | Optional | <as:date day="integer" month="integer" year="integer" format="valid format"/> | Only relevant for English: specifies the order of day and month; valid values: β’ βdmβ (default): {ordinal day} of {month} β’ βmdβ: {month} {ordinal day} | |
ending | Optional | <as:date day="integer" month="integer" year="integer" ending="valid ending"/> | Only relevant for German, Spanish and Italian. Specifies the suffix of the ordinal. β’. Valid values for German: - βeβ (default) - βenβ - βemβ - βesβ - βer" |
βοΈThis feature supports the following languages: EN, FR, IT, DE, ES
The conference is scheduled for <as:date day='30' month='6' year='2024' format='md'/>
Ich treffe dich am <as:date day='3' month='7' ending='en'/> in Berlin.
<as:address>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
street | Required | <as:address street='some name'/> | Name of the street; numbered streets and abbreviations are converted automatically |
number | Optional | <as:address number='some number' street='some name'/> | Street/house number; input.must be numeric |
addition | Optional | <as:address number='some number' street='some name' addition='some text'/> | Address additions such as Building numbers, unit numbers etc. |
city | Optional | <as:address number='some number' street='some name' city='some name'/> | city name |
zip-code | Optional | <as:address number='some number' street='some name' city='some zip-code'/> | zip-code; input must be alphanumeric |
us-state | Optional | <as:address number='some number'street='some name' city='some zip-code' us-state='some state'/> | For US-addresses: states in abbreviated format (e.g. CA, FL,..) |
country | Optional | <as:address number='some number' street='some name' city='some zip-code' us-state='some state' country='some country'/> | country name |
βοΈThis feature is supported in the following languages: EN, DE
Examples
Please send it to <as:address number='2743' street='159th Moon Blvd.' addition='apartment 20' city='Little Rock' zip-code='72211' us-state='AR'/>
Meine Adresse lautet <as:address street='HeinestraΓe' number='11c' zip-code='64288' city='Darmstadt' country='Deutschland'/>
βοΈThe attributes must be given in the order of the desired output.
<as:bleep>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
content | Required | <as:bleep content='some content'/> | Content to be censored |
βοΈBleep tags are only supported by the following providers: Google, Polly.
Examples
The following part <as:bleep content='contains words that need to be censored'/>.
<as:cardinal>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
number | Required | <as:cardinal content='some content'/> | Cardinal number; input must be numeric |
βοΈThis feature supports the following languages: EN, FR, IT, DE, ES
Example
The population of the small town grew to <as:cardinal number='54289'/> residents after the opening of a new industrial complex.
<as:currency>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
amount | Required | <as:currency amount='some name'iso-code='some iso-code'/> | Amount of the currency value. Input must be an integer or a decimal number |
iso-code | Required | <as:currency amount='some name' iso-code='some iso-code'/> | Iso-code of the currency; valid values are: "USD", "EUR", "SEK", "GBP", "HUF", "DM", "JPY", "HKD", "CNY", "FRF", "ESP", "ITL", "TRY", "INR", "CHF", "PLN", "CZK", "SAR", "AED", "NOK", "DKK", "BRL", "RUB", "MXN" |
βοΈThis feature is supported in the following languages: EN, FR, IT, DE, ES
Examples
In the USA, you pay <as:currency amount='350' iso-code='USD'/> for this.
Solo cuesta <as:currency amount='0.5' iso-code='EUR'/>.
<as:duration>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
h | Optional (must specify at least one of the attributes) | <as:duration h='some number'/> | hour; must be a positive integer or decimal number |
m | Optional (must specify at least one of the attributes) | <as:duration m='some number'/> | minute; must be a positive integer or decimal number |
s | Optional (must specify at least one of the attributes) | <as:duration s='some number'/> | second; must be a positive integer or decimal number |
ms | Optional (must specify at least one of the attributes) | <as:duration ms='some number'/> | millisecond; must be a positive integer or decimal number |
βοΈThis feature supports the following languages: EN, FR, IT, DE, ES
Examples
The flight to Montana takes <as:duration h='5' m='40'/>
In the USA, you pay <as:currency amount='350' iso-code='USD'/> for this.
Solo cuesta <as:currency amount='0.5' iso-code='EUR'/>.
<as:fraction>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
numerator | Required | <as:fraction numerator='some number' denominator='some number'/> | numerator of the fraction, input must be integer greater or equal to 1 |
denominator | Required | <as:fraction numerator='some number' denominator='some number'/> | denominator of the fraction, input must be integer greater or equal to 2 |
ending1 | Optional | <as:fraction numerator='some number' denominator='some number' ending1='some valid ending'/> | Only relevant for German; specifies the suffix of the numerator Valid values German: - β β - βeβ - βenβ - βemβ - βesβ - βerβ |
ending2 | Optional | <as:fraction numerator='some number' denominator='some number' ending2='some valid ending'/> | Only relevant for German; specifies the suffix of the denominator β’. Valid values German: - β β - βeβ - βenβ - βemβ - βesβ - βerβ |
βοΈThis feature is supported the following languages: EN, FR, IT, DE, ES
Examples
It only affects <as:fraction numerator='2' denominator='5'/> of the population.
Man braucht <as:fraction numerator='1' denominator='2' ending1='e' ending2='e'/> Tasse Zucker.
<as:unit>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
quantity | Required | <as:unit quantity='some number' unit='some valid unit'/> | quantity; must be integer or decimal number |
unit | Required | <as:unit quantity='some number' unit='some valid unit'/> | unit abbreviation, valid units are: 'km', 'pm', 'Β°F', 'F', 'kW', 'GW', 'cal', 'kWh', 'N', 'PB', 'mi', 'nm', 'K', 'MB', 'cm', 'Β°', 'kHz', 'kcal', 'kn', 'm2', 'ha', 'GB', 'kb', 'km3', 'TB', 'mm2', 'gr', 'hz', 'in', 'h', 'l', 'kg', 'mm', 'mA', 'Pa', '%', 'MHz', 'ft', 'mm2', 'cm2', 'TW', 'mW', 'km2', 'kB', 'km/h', 'mm3', 'cm3', 'Hz', 'mg', 'm3', 'Β° C', 'cm2', 'V', 'm2', 'A', 'lb', 'Ξ©', 'm3', 'hm', 'L', 'pg', 'C', 'oz', 'ΞΌC', 'mV', 'ΞΌm', 'ds', 'ΞΌg', 'Β°C', 'mm3', 'cm3', 'g', 'm', 'J', 'gal', 'hp', 'dB', 'dm', 'W', 'ml', 'bar', 'kV', 'GHz', 'Β° F' |
ending | Optional | Only relevant for German; specifies the suffix of the number if it is 1: β’. Valid values German: - β β - βeβ - βenβ - βemβ - βesβ - βerβ |
βοΈThis feature is supported in the following languages: EN, DE
Examples
It weighs <as:unit quantity='2.3' unit='kg'/>
It takes <as:unit quantity='50' unit='GB'/> of RAM.
<as:url-email>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
address | Required | <as:address='some url or email-address'/> | url or e-mail address |
βοΈThis feature supports the following languages: EN, DE
Examples
Contact the customer support team at <as:url-email address='[email protected]'/> for assistance.
Contact us via email at <as:url-email address='[email protected]'/> with your suggestions.
<as:time>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
h | Optional | <as:time h='some number' /> | hour of the day; input must be a positive integer between 0 and 23 βοΈIf a number in 24h format is used with an EN voice, AM/PM indicators are added automatically (e.g. βIt's <as:time h='23' minute='15'/>" β "It's eleven fifteen P Mβ | |
m | Optional | <as:time h='some number' m='some number' s='some number' /> | minute, input must be a positive integer between 0 and 59 |
s | Optional | seconds, input must be a positive integer between 0 and 59 | |
format | Optional | Only relevant for English, optional indicator, valid values: - β1β for βA Mβ - β2β for βP Mβ - β3β for βoβclockβ |
βοΈThis feature supports the following languages: EN, FR, IT, DE, ES
Examples
It's <as:time h='1' format='1'/>
Son las <as:time h='21' m='45'/>
<as:emphasis>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
level | Required | <as:emphasis levels='some valid value'> some text</as:emphasis> | Pre-defined emphasis strength, valid values: β’ none β’ reduced β’ moderate β’ strong |
Please Note:
- Resemble only supports the levels βreducedβ and βstrongβ
- Polly only supports the levels βstrongβ, βmoderateβ and 'reduced'
The following providers do not support prosody tags:
Elevenlabs, Wellsaid, Messner, Openai, Playht
Examples
It's not tomorrow, it's <as:emphasis level='strong'> today! </as:emphasis>
<as:lang>
Attributes
Attribute | Required | Syntax | Description |
---|---|---|---|
lang-code | Required | <as:lang lang-code='some valid lang-code'> some text</as:lang> | 'af-ZA', 'am-ET', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IL', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-PS', 'ar-QA', 'ar-SA', 'ar-SY', 'ar-TN', 'ar-YE', 'az-AZ', 'bg-BG', 'bn-IN', 'bs-BA', 'ca-ES', 'cs-CZ', 'cy-GB', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AU', 'en-CA', 'en-GB', 'en-GH', 'en-HK', 'en-IE', 'en-IN', 'en-KE', 'en-NG', 'en-NZ', 'en-PH', 'en-SG', 'en-TZ', 'en-US', 'en-ZA', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et-EE', 'eu-ES', 'fa-IR', 'fi-FI', 'fil-PH', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'ga-IE', 'gl-ES', 'gu-IN', 'he-IL', 'hi-IN', 'hr-HR', 'hu-HU', 'hy-AM', 'id-ID', 'is-IS', 'it-CH', 'it-IT', 'ja-JP', 'jv-ID', 'ka-GE', 'kk-KZ', 'km-KH', 'kn-IN', 'ko-KR', 'lo-LA', 'lt-LT', 'lv-LV', 'mk-MK', 'ml-IN', 'mn-MN', 'mr-IN', 'ms-MY', 'mt-MT', 'my-MM', 'nb-NO', 'ne-NP', 'nl-BE', 'nl-NL', 'pa-IN', 'pl-PL', 'ps-AF', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'so-SO', 'sq-AL', 'sr-RS', 'sv-SE', 'sw-KE', 'sw-TZ', 'ta-IN', 'te-IN', 'th-TH', 'tr-TR', 'uk-UA', 'ur-IN', 'uz-UZ', 'vi-VN', 'wuu-CN', 'yue-CN', 'zh-CN', 'zh-CN-shandong', 'zh-CN-sichuan', 'zh-HK', 'zh-TW', 'zu-ZA' |
Please Note:
For voices with base language other than English, the lang tag is only supported for Elevenlabs voices; for English, see availability in the table below
Availability for English voices:
Provider | Supported voices | Supported language codes |
---|---|---|
Elevenlabs | all voices | all language codes |
Resemble (stock) | adam, delilah, gene, gerald, hannah, josh, nathan, raymond, virginia, whispering-willow, zach | all language codes except: pa-IN, wuu-CN, yue-CN |
Azure | jenny | de-DE, en-AU, en-CA, en-GB, en-US, es-ES, es-MX, fr-CA, fr-FR, it-IT, ja-JP, ko-KR, pt-BR, zh-CN |
Examples
Welcome, <as:lang lang-code='de-DE'> Willkommen </as:lang> and <as:lang lang-code='es-MX'> Bienvenidos </as:lang>
Example for a cloned voice
Su vuelo a <lang xml:lang="en-us">Pearson International Airport</lang> partirΓ‘ en 30 minutos.
Please note:
By using any of these SSML tags, the Voice Intelligence Layer is automatically set to
True
.
Updated 2 months ago