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:

AttributeRequiredSyntaxDescription
timeOptional (must specify either time OR strength)<as:break time="string" />The absolute duration of a pause in seconds or millisecond
strengthOptional (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:

Deepzen, 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

AttributeRequiredSyntaxDescription
pitchOptional (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%
rateOptional (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.
volumeOptional (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:

Deepzen, 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

AttributeRequiredSyntaxDescription
charactersOptional (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
digitsOptional (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

InputOutput
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

AttributeRequiredSyntaxDescription
numberRequired<as:ordinal number="some number"/>The number to be spelled out as ordinal
endingOptional<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

AttributeRequiredSyntaxDescription
numbersRequired<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

AttributeRequiredSyntaxDescription
dayRequired<as:date day="integer" month=""integer/>Calendar day in numeric format; valid values: integers from 1-31
monthRequired<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
formatOptional<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} |
endingOptional<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

AttributeRequiredSyntaxDescription
streetRequired<as:address street='some name'/>Name of the street; numbered streets and abbreviations are converted automatically
numberOptional<as:address number='some number' street='some name'/>Street/house number; input.must be numeric
additionOptional<as:address number='some number' street='some name' addition='some text'/>Address additions such as Building numbers, unit numbers etc.
cityOptional<as:address number='some number' street='some name' city='some name'/>city name
zip-codeOptional<as:address number='some number' street='some name' city='some zip-code'/>zip-code; input must be alphanumeric
us-stateOptional<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,..)
countryOptional<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

AttributeRequiredSyntaxDescription
contentRequired<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

AttributeRequiredSyntaxDescription
numberRequired<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

AttributeRequiredSyntaxDescription
amountRequired<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-codeRequired<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

AttributeRequiredSyntaxDescription
hOptional (must specify at least one of the attributes)<as:duration h='some number'/>hour; must be a positive integer or decimal number
mOptional (must specify at least one of the attributes)<as:duration m='some number'/>minute; must be a positive integer or decimal number
sOptional (must specify at least one of the attributes)<as:duration s='some number'/>second; must be a positive integer or decimal number
msOptional (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

AttributeRequiredSyntaxDescription
numeratorRequired<as:fraction numerator='some number' denominator='some number'/>numerator of the fraction, input must be integer greater or equal to 1
denominatorRequired<as:fraction numerator='some number' denominator='some number'/>denominator of the fraction, input must be integer greater or equal to 2
ending1Optional<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”
ending2Optional<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

AttributeRequiredSyntaxDescription
quantityRequired<as:unit quantity='some number' unit='some valid unit'/>quantity; must be integer or decimal number
unitRequired<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'
endingOptionalOnly 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

AttributeRequiredSyntaxDescription
addressRequired<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

AttributeRequiredSyntaxDescription
hOptional<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 Optionalseconds, input must be a positive integer between 0 and 59
format OptionalOnly 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

AttributeRequiredSyntaxDescription
levelRequired<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, Deepzen, Openai, Playht

Examples

It's not tomorrow, it's <as:emphasis level='strong'> today! </as:emphasis> 

<as:lang>

Attributes

AttributeRequiredSyntaxDescription
lang-codeRequired<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:

ProviderSupported voicesSupported language codes
Elevenlabsall voicesall language codes
Resemble (stock)adam, delilah, gene, gerald, hannah, josh, nathan, raymond, virginia, whispering-willow, zachall language codes except:
pa-IN, wuu-CN, yue-CN
Azurejennyde-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.