Step 1 – Install Python on Windows laptop/desktop
- Open cmd and type python3 and press enter
- If you don’t have Python installed already, it will take you to Windows Store, click on Get
- Prep for Polly execution
pip3 install boto3
pip3 install --upgrade awscli
Step 2 – Create dummy polly.py
import boto3
polly_client = boto3.Session(
aws_access_key_id=‘<access key>',
aws_secret_access_key=<secret access key>',
region_name='us-east-2').client('polly')
response = polly_client.synthesize_speech(VoiceId='Joanna',
OutputFormat='mp3',
Text = 'This is a sample text to be synthesized.')
file = open('speech.mp3', 'wb')
file.write(response['AudioStream'].read())
file.close()
Step 3 – Execute polly.py and play speech.mp3
python3 polly.py
Successful execution of the script should create a speech.mp3 file.