Amazon Polly for WordPress

Description

Amazon Polly is a service that turns text into lifelike speech. With dozens of voices across a variety of languages, you can select the ideal voice and build engaging speech-enabled applications that work in many different countries. The Amazon Polly plugin for WordPress is a sample application that shows how WordPress creators can easily add Text-to-Speech capabilities to written content with Amazon Polly. You can generate an audio feed for text-based content and insert it into an embedded player to increase the accessibility of your WordPress site. The sample code also enables you to publish podcasts directly from your site and make them available for listeners in the form of podcasts.

Screenshots

The view of the configuration settings page for the plugin.

When generating text-based content, the user can also produce a voiced version of the same content by activating Amazon Polly.

After activation of the plugin, each voiced section will have its own play button, which will allow the end user to listen to the content.

Installation

Install this plugin from the ‘Add new Plugin’ option from your WordPress installation.

After you install (and activate) the plugin, please go to the ‘Amazon Polly’ settings tab in your WordPress admin interface and fill out the configuration settings for your plugin. You will need to have the Access Key and Secret Key to your own AWS account in order to finish the configuration of the plugin – you can find instructions about obtaining those below.
2.1 If you deployed your WordPress on EC2, you can also use the functionality of IAM Roles for EC2 – in this case you won’t need to provide the keys on the configuration page. For more details please visit: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

Additional configuration options which you can change:

General:
– Sample rate: The audio frequency specified in Hz.
– Voice name: The voice which should be used to create audio.
– Player oosition: Position of the ‘play’ button on your WordPress page. (Below or After the post, or no button)
– New post default: Define if transcription should be enabled by default for new posts.
– Autoplay: Information if the audio should be played automatically on ’singular’ post page.

Cloud Storage:
– Store audio in Amazon S3: If you will select this option, audio files won’t be stored on WordPress server, but instead they will be stored on Amazon S3 service. For additional information and pricing, please visit: https://aws.amazon.com/s3.
– Amazon CloudFront (CDN) Domain Name: The name of you CloudFront domain, which should be used to stream audio. You will need to create it first in AWS, and then provide it’s name here.

Additional Configuration
– Bulk update all posts: Update all posts with new configurations: If you will click on the button, the plugin will update all your posts according to your new plugin configuration.

How to obtain Access Key and Secret Key?
1. We assume, that you have got already AWS Account. If not, please got to https://aws.amazon.com/ and create one.
2. Sign in to the AWS Console from https://aws.amazon.com/ page.
3. Type “IAM” in the search field, after click on it, you will be redirect to IAM (Identity and Access Management service).
4. On the left menu, look for the ‘Policies’ label – click on it. You will see a list of already created policies, we will create new one (“Create Policy” – button).
5. Choose “JSON” view, and paste following code there:{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Permissions1",
"Effect": "Allow",
"Action": [
"s3:HeadBucket",
"polly:SynthesizeSpeech",
"polly:DescribeVoices"
],
"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*"
}
]
}
6. On the second step of the wizard provide the name for your policy: PollyForWordPressPolicy and create it.
7. The next step will be to create a IAM User. To do this, on the left menu choose ‘Users’ label. There click on ‘Add User’ button.
8. Provide a name for your user, for example: “WordPress” and select “Programmatic access” option. Go to the step number 2.
9. On the “Permission” step, choose ‘Attach existing policies directly’ option, and then on the list provide the name of the policy which we have created in step 6 (PollyForWordPressPolicy).
10. On the “Review” step click on “Create User” button.
11. On step, you will see information that the user was created. You need to note “Access key ID” and “Secret access Key” – you will need to provide them on the plugin configuration page.

FAQ

Installation Instructions

Install this plugin from the ‘Add new Plugin’ option from your WordPress installation.

After you install (and activate) the plugin, please go to the ‘Amazon Polly’ settings tab in your WordPress admin interface and fill out the configuration settings for your plugin. You will need to have the Access Key and Secret Key to your own AWS account in order to finish the configuration of the plugin – you can find instructions about obtaining those below.
2.1 If you deployed your WordPress on EC2, you can also use the functionality of IAM Roles for EC2 – in this case you won’t need to provide the keys on the configuration page. For more details please visit: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

Additional configuration options which you can change:

General:
– Sample rate: The audio frequency specified in Hz.
– Voice name: The voice which should be used to create audio.
– Player oosition: Position of the ‘play’ button on your WordPress page. (Below or After the post, or no button)
– New post default: Define if transcription should be enabled by default for new posts.
– Autoplay: Information if the audio should be played automatically on ’singular’ post page.

Cloud Storage:
– Store audio in Amazon S3: If you will select this option, audio files won’t be stored on WordPress server, but instead they will be stored on Amazon S3 service. For additional information and pricing, please visit: https://aws.amazon.com/s3.
– Amazon CloudFront (CDN) Domain Name: The name of you CloudFront domain, which should be used to stream audio. You will need to create it first in AWS, and then provide it’s name here.

Additional Configuration
– Bulk update all posts: Update all posts with new configurations: If you will click on the button, the plugin will update all your posts according to your new plugin configuration.

How to obtain Access Key and Secret Key?
1. We assume, that you have got already AWS Account. If not, please got to https://aws.amazon.com/ and create one.
2. Sign in to the AWS Console from https://aws.amazon.com/ page.
3. Type “IAM” in the search field, after click on it, you will be redirect to IAM (Identity and Access Management service).
4. On the left menu, look for the ‘Policies’ label – click on it. You will see a list of already created policies, we will create new one (“Create Policy” – button).
5. Choose “JSON” view, and paste following code there:{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Permissions1",
"Effect": "Allow",
"Action": [
"s3:HeadBucket",
"polly:SynthesizeSpeech",
"polly:DescribeVoices"
],
"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*"
}
]
}
6. On the second step of the wizard provide the name for your policy: PollyForWordPressPolicy and create it.
7. The next step will be to create a IAM User. To do this, on the left menu choose ‘Users’ label. There click on ‘Add User’ button.
8. Provide a name for your user, for example: “WordPress” and select “Programmatic access” option. Go to the step number 2.
9. On the “Permission” step, choose ‘Attach existing policies directly’ option, and then on the list provide the name of the policy which we have created in step 6 (PollyForWordPressPolicy).
10. On the “Review” step click on “Create User” button.
11. On step, you will see information that the user was created. You need to note “Access key ID” and “Secret access Key” – you will need to provide them on the plugin configuration page.

Do I need to have AWS account to be able to start using the plugin?

Yes. You can create your own AWS account here: https://aws.amazon.com/free/

What is Amazon Polly?

Amazon Polly is a service that turns text into lifelike speech. Amazon Polly enables existing applications to speak as a first class feature and creates the opportunity for entirely new categories of speech-enabled products, from mobile apps and cars, to devices and appliances. Amazon Polly includes dozens of lifelike voices and support for multiple languages, so you can select the ideal voice and distribute your speech-enabled applications in many geographies. Amazon Polly is easy to use – you just send the text you want converted into speech to the Amazon Polly API, and Amazon Polly immediately returns the audio stream to your application so you can play it directly or store it in a standard audio file format, such as MP3. Amazon Polly supports Speech Synthesis Markup Language (SSML) tags like prosody so you can adjust the speech rate, pitch, or volume. Amazon Polly is a secure service that delivers all of these benefits at high scale and at low latency. You can cache and replay Amazon Polly’s generated speech at no additional cost. Amazon Polly lets you convert 5M characters per month for free during the first year, upon sign-up. Amazon Polly’s pay-as-you-go pricing, low cost per request, and lack of restrictions on storage and reuse of voice output make it a cost-effective way to enable speech synthesis everywhere.

Please see the Amazon Polly Pricing Page (https://aws.amazon.com/polly/pricing/) for current pricing information.

Does Amazon Polly participate in the AWS Free Tier?

Yes, as part of the AWS Free Usage Tier (https://aws.amazon.com/free/), you can get started with Amazon Polly for free. Upon sign-up, new Amazon Polly customers can synthesize up to 5M characters for free each month for the first 12 months.

Does plugin delete my audio files if I will delete the plugin?

No. All audio files are being preserved. Depending on your configuration, they will be stored on your WordPress server, or on your Amazon S3 bucket.

Reviews

This plugin works well. However, I have a few suggestions for future development:

1. Really easy to set this up if you follow the tutorial guide. Perhaps a link to this guide could be included in the plugin settings page in the WP admin area for those who can’t find it.

2. It only works for posts, not pages, and not WooCommerce product pages. Perhaps support could be added for these?

3. You have to manually edit and update each post in order to actually have Polly create audio for each post. This would take ages to do on a reasonably-sized WordPress website. We need a “create recordings for all pre-existing pages/posts/products” button.

4. It would be useful to be able to disable the podcasting system entirely as I already have a podcasting plugin.

5. It would be useful if we can have a checkbox to disable input into the IAM access key ID and secret key fields. This way my browser password manager will stop automatically switching the IAM credentials with my WP admin login credentials.

Thanks in advance for considering the above, and thanks for making this plugin. I see it having a bright future!