I am working on a Python script to convert SSML into audio for an application. I already have the text conversion working, but I am figuring out the SSML part by experimenting in the console.
From the documentation: https://docs.aws.amazon.com/polly/latest/dg/supported-ssml.html#emphasis-tag there is an example using the emphasis tag with the level parameter:
<speak>
I already told you I <emphasis level="strong">really like</emphasis> that person.
</speak>
When I enter my SSML into the console:
<speak>
Hi there. My name is Joanna.
<p>This is line 2</p>
I am really <emphasis level=“strong”>excited</emphasis> to be here with you today.
</speak>
After pressing the “Listen to audio” button, the console returns an error
the input text contains invalid SSML syntax. Fix the SSML syntax and then try again.
If I remove the level keyword so the SSML reads
<speak>
I am really <emphasis>excited</emphasis> to be here with you today.
</speak>
it is converted correctly.
The example provided in the Polly documentation works, but I cannot figure out why my text has an error.
So it turns out, that typing into the text input box in the console on an iPad will change the quotes if you have "Smart Punctuation" turned on, and the quotes inserted using that feature will break the SSML processing engine.
On the iPad, go to General->keyboards->Smart Punctuation. If it is turned on, disable it. It makes no difference if you are using the on-screen keyboard or a hardware keyboard. If this setting is enabled, the quotes are replaced.