Amazon Polly is a text-to-speech service which turns text into life-like speech, allowing you to create applications that talk in a human voice. The human voice could be selected appropriately while configuring the service based on the region/location where the speech needs to be delivered. For example, for India, it supports voice with Name as Aditi and Raveena. The complete list can be found on this page, AWS Polly Available Voices.
There could be many applications which could be built around Amazon/AWS Polly by integrating Polly with other AWS services or telephony services such as Twilio. For example, phone alerts/notifications, reminders, feedback, results etc.
In this post, you would learn about how to get set up with Amazon/AWS Polly using AWS CLI.
Setup Amazon Polly with AWS CLI
In order to get setup with AWS CLI, it is recommended to use PIP. Recall that PIP is a package management system used to install and manage software packages written in Python. Before proceeding ahead, make sure you meet the minimum requirements for Polly to work:
- Python 2 version 2.6.5+ or Python 3 version 3.3+
- Supported OS are Windows, Linux, MacOS or Unix
The following are instructions to set up AWS CLI:
- Install PIP: This page, How to install PIP on Ubuntu, would help you get setup on Ubuntu. This page, How to Install PIP for Python on Windows, Mac, and Linux would help you get setup with PIP on Win, Unix or Mac.
- Install AWS CLI: Next step is to install AWS CLI. The following command can be used:
pip install awscli --upgrade --user
The –upgrade option is for upgrading any requirements which are already installed. The –user option is for installing the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.
- If all goes well, you should be able to get AWS CLI version by executing following command:
- Configure AWS CLI: Next step is to configure AWS CLI which will be required to work with or executing the AWS CLI commands. It could be done by executing the following command. The greater details could be found on this page, Configuring the AWS CLI
- Check if the following command gives the detail on Amazon Polly. If it gives the detail, you are good.
aws polly help
- If above command does not work, download this file, service-2.json. Let’s say, the file is downloaded in /home/ajitesh/downloads folder.
- Execute the following command for setting up Polly:
aws configure add-model --service-model file:///home/ajitesh/downloads/service-2.json --service-name polly
- Check if the following command gives the detail/description on Amazon Polly. If it gives the detail, you are good to go.
aws polly help
Further Reading / References
In this post, you learned about how to get started with or set up or access Amazon Polly using AWS CLI.
Did you find this article useful? Do you have any questions or suggestions about this article in relation to getting set up Amazon Polly with AWS CLI? Leave a comment and ask your questions and I shall do my best to address your queries.
He has also authored the book, Building Web Apps with Spring 5 and Angular.
Latest posts by Ajitesh Kumar (see all)
- AWS SNS Example with Spring Boot & Java - March 20, 2018
- Spring Boot & Angular 5 PWA Dev Environment Setup - March 18, 2018
- How-to Tutorials for Spring Security OAuth2 & REST API - March 18, 2018