Skip to content
Menu
Cloud Gal 42
  • Home
Cloud Gal 42

QuickGuide: Use AWS Polly on Windows 10 to synthesize speech from text

May 22, 2021 by admin

Step 1 – Install Python on Windows laptop/desktop

  1. Open cmd and type python3 and press enter
  2. If you don’t have Python installed already, it will take you to Windows Store, click on Get
  3. 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.

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Role of AI/ML in Cybersecurity
  • QuickGuide: Security on OCI
  • The Cloud Management Plane
  • Secure Installation and Configuration of Virtualized Cloud Datacenters
  • Cloud Datacenter: Hardware-specific Security Configuration Requirements

Recent Comments

  • Rafael on Installing Debian on OCI
  • Jorge on Installing Debian on OCI
  • admin on Installing Debian on OCI
  • Andreas on Installing Debian on OCI
  • admin on Installing Debian on OCI

Archives

  • December 2022
  • February 2022
  • September 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • February 2021
  • January 2021
  • November 2020
  • October 2020

Categories

  • aws
  • bcdr
  • cloud
  • cloudsecurity
  • compliance
  • informationsecurity
  • oracle
  • pci
  • QuickGuide
  • security
©2025 Cloud Gal 42 | Powered by WordPress and Superb Themes!