How To Use Amazon Polly To Turn WordPress Content Into Lifelike Audio

Published

No matter how great your site’s typography is, you’ll always have some visitors who’d prefer to hear your content rather than read it. But short of breaking out your microphone for every blog post, there wasn’t an easy way to cater to those readers, until along came Amazon Polly.
Amazon Polly is a smart service that can automatically transform your WordPress text content into playable audio. And in this post, we’ll show you step-by-step how you can use Amazon Polly on your WordPress site.

The Specifics On How Amazon Polly Turns Your Text Into Audio

Amazon Polly is a machine learning-powered service that turns text into lifelike speech. That “lifelike” is the important part because text-to-speech tools have been around for years now.
Essentially, you provide the Amazon Polly service with a chunk of text. Then, Amazon Polly gives you back an audio file of one of Amazon Polly’s many voices reading that text.
Where Amazon Polly differentiates itself from those old-style text-to-speech tools is that it ditches the monotone robotic voice, replacing it with a voice that’s surprisingly close to that of a real human, complete with real pauses to breathe!
It might not feel like you’re chatting with a friend in the coffee shop, but the voice is natural enough that most people will be able to comfortably listen to Amazon Polly read large volumes of text.
Currently, Amazon Polly supports 24 different languages. And each language also gets its own set of voices for you to choose from.
For example, US English offers eight different voices (many other languages only have one or two voices, though).
If you’d like to hear how these voices sound, you can head to the Amazon Polly console. You will need to sign in or create a free AWS account in order to view the console (we’ll show you how to do this in a second if you’d like some help).

Three Ways That Amazon Polly Can Benefit Your WordPress Site

Thanks to an official Amazon Polly for WordPress plugin from AWS Labs you can use Amazon Polly to automatically generate an audio feed for your regular WordPress text content.
You’ll be able to toggle the text-to-speech functionality on or off on a per-post basis. And the plugin can even automatically add an audio player before or after your content.
Here are three ways that this functionality can help your WordPress site:
First, it gives all of your readers the ability to interact with your website in more ways. Just like some people prefer listening to audiobooks over reading physical books, there are people who might prefer an audio version of your content over the written version.
The audio player helps make that available on your site. And the Amazon Polly for WordPress plugin can also go one step further and actually generate a podcast feed of your blog posts. That means people can subscribe to the audio version of your blog post content just like they would other podcasts.
Second, Amazon Polly makes your website more accessible to visually impaired visitors who aren’t able to read your site. Rather than relying on their screen reader, visually impaired visitors will be able to play a much more lifelike audio version of your content.
Finally, the Amazon Polly plugin also supports Amazon Translate, which means that you can use it as a tool to help localize your WordPress site. That is, you can seamlessly use Amazon Translate to translate your content into any one of the 24 languages that Amazon Polly supports. Then, you can have Amazon Polly create a localized audio version for visitors from around the globe.
Thanks to the official Amazon Polly for WordPress plugin, it’s easy to start using Amazon Polly on your WordPress site.
Over the next few sections, we’ll show you the step-by-step process that you need to follow to add this functionality to your site.

How To Use Amazon Polly On WordPress: Step-by-Step

We’ll show you each step in detail, but here’s the broad process that you’ll need to follow:

  1. Install the Amazon Polly for WordPress plugin
  2. Create an AWS account (or sign in to your existing account)
  3. Create an IAM policy for the plugin
  4. Add an IAM user for the plugin and give it access via the policy that you created
  5. Add your IAM user’s Access Key ID and Secret Access Key to the plugin’s settings
  6. Configure the plugin’s settings for voice style, audio player position, etc.
  7. Activate or deactivate Amazon Polly on a content-by-content basis

While we’ll try to make this as beginner-friendly as possible, you will need at least some basic understanding of AWS to get set up. If you’d like some help, our team of WordPress experts has deep experience with using AWS alongside WordPress (just send us a message or give us a call).

Step 1: Install The Amazon Polly for WordPress Plugin

Because this plugin is free and available at WordPress.org, you can install it directly from your WordPress dashboard:
Amazon Polly for WordPress plugin

Step 2: Create An IAM Policy In Your AWS Account

For this step, you’ll need to access your AWS account. If you already have an account, go ahead and sign in. If you don’t, head here to create your free account.
Once you’re in the AWS Management Console, search for IAM in the search box and select the IAM result:
IAM
Then, select Policies and click Create policy:
Create new IAM policy
In the Create policy interface, switch to the JSON tab. Then, paste in the following JSON snippet:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Permissions1",
"Effect": "Allow",
"Action": [
"s3:HeadBucket",
"polly:SynthesizeSpeech",
"polly:DescribeVoices",
"translate:TranslateText"
],
"Resource": "*"
},
{
"Sid": "Permissions2",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketAcl",
"s3:GetBucketPolicy",
"s3:PutObject",
"s3:DeleteObject",
"s3:CreateBucket",
"s3:PutObjectAcl"
],
"Resource": ["arn:aws:s3:::audio_for_wordpress*","arn:aws:s3:::audio-for-wordpress*"]
}
]
}

IAM policy JSON
Once you’ve added the JSON snippet, click Review policy in the bottom-right corner.
On the next page, enter PollyForWordPressPolicy in the Name field and then click Create policy:
Configure IAM policy

Step 3: Create New IAM User And Assign It The Policy

Next, you need to create a user with access to the policy that you just created. You’ll do this from the same IAM interface.
To get started, go to Users and then select Add user:
Add User
Make the user’s name WordPress. Then, select Programmatic access under Access type:
Give user access
Once you’ve done that, click Next: Permissions in the bottom-right corner.
On the next screen, choose Attach existing policies directly.
Then, search for PollyforWordPressPolicy to find the policy that you created in the previous step.
Once you’ve found it, check the box and click Next: Review:
Assign the policy
On the next page, click Create user in the bottom-right corner to finish the process:
Create the user
AWS will then provide you with the user’s Access key ID and Secret access key. Keep this information handy because you’ll need it in the next step:
AWS Access keys

Step 4: Add Access Keys To Amazon Polly For WordPress Plugin

While leaving the window with your access keys open, go back to your WordPress dashboard and navigate to Amazon Polly → General. Then, add your AWS access key and AWS secret key to the boxes:
Add access keys to WordPress plugin
Then, save your changes.
If you did everything correctly, you should see a success message and a bunch of new settings:
Success message

Step 5: Configure Plugin Default Settings

Next, you need to enable the specific functions that you want. You have three options for:

  • Text-To-Speech
  • Translate
  • Podcast

At a minimum, you’ll want to enable Text-To-Speech, but you can consider the other options as well.
Enable text-to-speech
Once you enable text-to-speech support, you’ll be able to configure:

  • Which voice to use
  • The sample rate
  • Automated breaths (this is what helps make Amazon Polly sound human)
  • Audio player position (before or after your post)
  • Etc.

Similarly, the other features also include their own unique settings.

Step 6: Enable Or Disable Amazon Polly For Individual Pieces Of Content

Once you’ve configured the plugin’s default settings, the final step is to enable the text-to-speech content for individual pieces of content.
When you’re working in the WordPress editor, you’ll get a new Amazon Polly meta box that lets you:

  • Enable or disable the text-to-speech functionality (it’s disabled by default)
  • Choose a different voice on a post-by-post basis.

Amazon Polly for WordPress meta box
And once you enable the text-to-speech functionality, your visitors will see the audio player on the front-end of your site at the location that you specified:
An example of Amazon Polly on the front-end

Get Started With Amazon Polly For WordPress Today!

Once you set up Amazon Polly, your visitors will be able to enjoy audio versions of all the content that you enable Amazon Polly for. And you can even create a podcast feed or translate your content into other languages if you want to take things a step further.
If you’d like some more personalized assistance with getting Amazon Polly up and running on your WordPress site, we’d love to help. Reach out via our contact form and we’ll get back to you as soon as possible.