Giter Site home page Giter Site logo

snipd-min / flutter_aws_polly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robrichardson13/flutter_aws_polly

0.0 0.0 0.0 185 KB

A simple, unofficial AWS Polly client in dart. Supports generating a URL given an input text and voice identifier.

License: MIT License

Ruby 7.06% Objective-C 2.08% Kotlin 12.07% Dart 41.79% Swift 37.00%

flutter_aws_polly's Introduction

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

AWS Console

Here are the steps to generate a functional Pool ID in the AWS Console

  1. You must have first have an account with AWS.
  2. Go to the Amazon Cognito console.
  3. Click on Manage Identity Pools and Create new identity pool.
  4. Name the new identity pool and make sure to check Enable access to unauthenticated identities.
  5. After creating the pool you'll be given your Identity pool ID, which will look something like us-east-1:xxxx-xxx-xxxxx
  6. Now we need to give our new IAM policy the correct permissions, so go to the IAM Console.
  7. Click on Roles, find your newly created Unauth_Role and click it.
  8. 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';

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,
);

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!',
);

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 !

flutter_aws_polly's People

Contributors

robrichardson13 avatar snipd-min avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.