aws_polly

Creator: coderz1093

Last updated:

1 purchases

TODO
Add to Cart

Description:

aws polly

Flutter AWS Polly Plugin #
This plugin is a Flutter wrapper for AWS Polly which is a cloud service that converts text into lifelike speech.
Getting Started #
Add this to your package's pubspec.yaml file:
dependencies:
aws_polly: ^2.1.1
copied to clipboard
AWS Console #
Here are the steps to generate a functional Pool ID in the AWS Console

You must have first have an account with AWS.
Go to the Amazon Cognito console.
Click on Manage Identity Pools and Create new identity pool.
Name the new identity pool and make sure to check Enable access to unauthenticated identities.
After creating the pool you'll be given your Identity pool ID, which will look something like us-east-1:xxxx-xxx-xxxxx
Now we need to give our new IAM policy the correct permissions, so go to the IAM Console.
Click on Roles, find your newly created Unauth_Role and click it.
Click on Attach policies and search for AmazonPollyReadOnlyAccess and add it to the role.

Usage #
Then you just have to import the package with
import 'package:aws_polly/aws_polly.dart';
copied to clipboard
In order to generate a URL to play first create the client using your new poolId and region (USEast1 is the default).
final AwsPolly _awsPolly = AwsPolly.instance(
poolId: 'us-east-1:xxxx-xxx-xxxxx',
region: AWSRegionType.USEast1,
);
copied to clipboard
Then in order to generate a new URL, simply call on the getUrl() function:
final url = await _awsPolly.getUrl(
voiceId: AWSPolyVoiceId.nicole,
input: 'This is a sample text playing through Poly!',
);
copied to clipboard
Be sure to check the example project to see how to turn the .mp3 URL into a playable audio file.
Feedback #
Please feel free to give me any feedback helping support this plugin !

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.