In this exercise, you will take a quick tour of the Amazon Polly console to generate speech.
Access AWS Polly and click Try Polly
Click Listen to replay the default text for the default voice ‘Joanna’.
Spend a few moments experimenting with the different languages and voices that are available.
Download an MP3 file of the synthesised speech by clicking Download. Replay this file on your laptop.
Define and use a Lexicon
Select English, US and the Joanna voice and enter this text in to the Input text field:
Synthesising speech is easy with AWS
Press Listen to hear the text converted to speech.
We will now define an alias for AWS so that the full name - Amazon Web Services is rendered when AWS is provided. Download this file to your development machine: lexicon.pls
If you are running on Windows or on your own machine, don’t forget to add the profile with --profile aws-lab-env
This will create a new lexicon. The definition of the lexicon is this:
Notice how we can define an alias for a given grapheme. When this is rendered, the engine will replace AWS with Amazon Web Services.
Refresh the browser window containing the Polly console so that the new lexicon is available.
Enter this text in the Text inputfield:
Synthezising speech is easy with AWS
Scroll down to and expand the Additional settings section. Click on Customise pronunciation.
In the Apply lexicon drop-down list, select awsExpansion
Scroll back up and click Listen to hear the text converted to speech.
Sử dụng SSML để biểu diễn giọng nói
Click the SSML toggle on the right and paste in the following SSML:
<speak>
My name is YOUR_NAME. It is spelled
<prosody rate='x-slow'>
<say-as interpret-as="characters">YOUR_NAME</say-as>
</prosody>
</speak>
Note: Replace YOUR_NAME with your name.
Click Listen to hear your name spelled out.
Replace the SSML text with:
<speak>
This is normal voice,
<amazon:effect name="whispered">
and this is me whispering AWS!
</amazon:effect>
</speak>
Click Listen to hear the text read in normal voice, and also whispered.
Spend a few moments experimenting with the various voices and text samples to get a feel for what Polly can do