Explore the Amazon Polly Console

In this exercise, you will take a quick tour of the Amazon Polly console to generate speech.

  1. Access AWS Polly and click Try Polly

Polly

  1. Click Listen to replay the default text for the default voice ‘Joanna’.

Polly

  1. Spend a few moments experimenting with the different languages and voices that are available.
  2. Download an MP3 file of the synthesised speech by clicking Download. Replay this file on your laptop.

Define and use a Lexicon

  1. Select English, US and the Joanna voice and enter this text in to the Input text field:
Synthesising speech is easy with AWS

Polly

  1. Press Listen to hear the text converted to speech.
  2. 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
  1. In a terminal window, cd into the folder where you downloaded the lexicon.pls, and issue this command:
aws polly put-lexicon --name awsExpansion --content file://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.

  1. Refresh the browser window containing the Polly console so that the new lexicon is available.

Polly

  1. Enter this text in the Text inputfield:
Synthezising speech is easy with AWS
  1. Scroll down to and expand the Additional settings section. Click on Customise pronunciation.
  2. In the Apply lexicon drop-down list, select awsExpansion
  3. Scroll back up and click Listen to hear the text converted to speech.

Polly

Sử dụng SSML để biểu diễn giọng nói

  1. 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.

Polly

  1. Click Listen to hear your name spelled out.
  2. Replace the SSML text with:
<speak>
	This is normal voice,
	<amazon:effect name="whispered">
		and this is me whispering AWS!
	</amazon:effect>
</speak>

Polly

  1. Click Listen to hear the text read in normal voice, and also whispered.
  2. Spend a few moments experimenting with the various voices and text samples to get a feel for what Polly can do