- Newest
- Most votes
- Most comments
Hi Deepak, <voice> is not a supported tag in Polly SSML [https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html]. Instead you pass in the voice id when you call Polly, for instance here is an example for the CLI:
aws polly synthesize-speech --text-type ssml --output-format mp3 --voice-id Aditi --text "<speak><p>Text to be spoken<emphasis level='moderate'>Simply Divine</emphasis><break time='500ms'/>Text to be spoken</p></speak>" speech.mp3
You can find code examples for various languages for the SynthesizeSpeech linked under here: [https://docs.aws.amazon.com/polly/latest/dg/samples-and-examples.html]
Below is the updated version of your whole SSML updated without the <voice> tags that should work on the console and save successfully to S3.
<speak>
<p>
Text to be spoken
<emphasis level='moderate'>Simply Divine</emphasis>
<break time='500ms'/>
Text to be spoken
</p>
<p>
Text to be spoken
<break time='400ms'/>
Text to be spoken
</p>
<p>
Text to be spoken
</p>
<p>
Text to be spoken
<break time='700ms'/>
Text to be spoken
</p>
<p>
Text to be spoken
<break time='500ms'/>
Text to be spoken
</p>
<p>
Text to be spoken <prosody rate='85%'>Text to be spoken</prosody> Text to be spoken
</p>
<p>
Text to be spoken <prosody volume='+2dB'>156</prosody> Text to be spoken Text to be spoken
</p>
<p>
Text to be spoken
</p>
<p>
Text to be spoken
<emphasis level='strong'>Text to be spoken</emphasis>
</p>
</speak>
answered 2 years ago
Hi,
Did you activate the SSML switch in the interface ?
Also, it seems that SSML is not supported with all voice engines: on my side, it doesn't work for example with "Generative" but works fine with "Standard"
This works for example:
<speak>
My favorite chemical element is <sub alias="Mercury">Hg</sub>, because it looks so shiny.
</speak>
Best,
Didier
After reviewing the provided SSML code for Amazon Polly, I can confirm that there are no apparent syntax errors in the given markup. The code appears to be well-structured and follows the correct SSML format for use with Amazon Polly's standard voices.
The code includes proper use of various SSML tags such as:
<speak>as the root element<p>for paragraph breaks<voice>to specify the voice (Aditi in this case)<emphasis>for emphasizing specific words or phrases<break>for inserting pauses<prosody>for adjusting speech rate and volume
All these tags are correctly nested and closed. The attributes used (such as name for voice, level for emphasis, time for breaks, rate for prosody speed, and volume for prosody volume) are all valid and properly formatted.
It's worth noting that while this SSML code is syntactically correct, its effectiveness may depend on the specific requirements of your use case and how Amazon Polly interprets certain combinations of tags and attributes. However, from a purely syntactical standpoint, there are no errors in the provided code.
Sources
AWS Polly Neural voice misreading words | AWS re:Post
Setting a maximum duration for synthesized speech - Amazon Polly
@Oleksii, why is this reviewed? It clearly contains incorrect information - Polly does not support
<voice>tag (https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html).
Relevant content
asked 3 years ago
asked 6 years ago
asked 5 months ago
- AWS OFFICIALUpdated 5 years ago
- AWS OFFICIALUpdated 3 years ago

It's working but it also speaking the syntax like speak, p, emphasis level = moderate etc while speaking the text to be spoken as well? What's gone wrong now?
@Deepak, if you are using the console ensure you toggle on "SSML" above the input text box, and if you are using the API ensure you are setting text-type to ssml.