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

Overview

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: ^1.0.3

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 !

You might also like...

Args simple - A simple argument parser and handler, integrated with JSON and dart

args_simple A simple argument parser and handler, integrated with JSON and dart:

Jan 22, 2022

An Android app to encrypt plain text notes

AndSafe AndSafe is an Android app that encrypts plain text notes. With version 3, AndSafe3 is re-implemented with Flutter and is now open source. FAQ

Jul 9, 2022

With this package you can display numbers or any other text more nicely

With this package you can display numbers or any other text more nicely

flutter_number_animation With this package you can display numbers or any other text more nicely Preview Works with text too! How to use Add this to y

Jun 7, 2022

An example todo list back end project that uses gRPC for client-server communication and Firestore for data storage

An example todo list back end project that uses gRPC for client-server communication and Firestore for data storage

Apr 18, 2022

A Dart build script that downloads the Protobuf compiler and Dart plugin to streamline .proto to .dart compilation.

A Dart build script that downloads the Protobuf compiler and Dart plugin to streamline .proto to .dart compilation.

Oct 26, 2022

simplified man-pages, a tldr.sh client

simplified man-pages, a tldr.sh client

Report bug · Request feature Table of contents Overview Screenshots CI Build and run Bugs and feature requests Contributing Creators Copyright and lic

Dec 27, 2022

This is the client application for connecting to cptserver

This is the client application for connecting to cptserver. CPT stands for Course Participation Tracker.

Nov 2, 2022

Simple GEL converter to showcase Flutter basics. Fundamental widgets and simple methods.

gel_converter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Oct 17, 2021

A simple command-line application to generate simple folder and file structure for Flutter Applications

A simple command-line application to generate simple folder and file structure for Flutter Applications

Kanza_cli is a simple command line tool to generate folder and file structure for your Flutter apps. To use it, you should do the followings: 1. First

Dec 16, 2022
Comments
  • Unresolved reference: kotlinx

    Unresolved reference: kotlinx

    Good day sir,

    I am trying to use the latest version of this Lib and finding errors around the use of Kotlinx. Can you advise on how to fix or maybe you have an update coming soon?

    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (14, 8): Unresolved reference: kotlinx
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (15, 8): Unresolved reference: kotlinx
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (16, 8): Unresolved reference: kotlinx
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (17, 8): Unresolved reference: kotlinx
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (33, 27): Unresolved reference: CoroutineScope
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (33, 42): Unresolved reference: Dispatchers
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (33, 59): Unresolved reference: Job
    e: /Users/****/flutter/.pub-cache/hosted/pub.dartlang.org/aws_polly-2.1.1/android/src/main/kotlin/io/robrichardson/aws_polly/AwsPollyPlugin.kt: (83, 21): Unresolved reference: launch
    

    Thanks for building this library, cannot wait to use it.

    opened by RedMillLtd 1
  • Missing implementation error

    Missing implementation error

    I am trying to work with this package to integrate the AWS Polly service, but the error not letting me do.

    Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel aws_polly)

    opened by Tarunvegi-dev 1
  • Request for Neural Engine options

    Request for Neural Engine options

    Hi, Is it possible to add the Engine options? I would like to use the Neural instead of Standard. Besides, could you mind update the aws sdk to latest version?

    opened by lookx2 1
  • Erro AmazonPollyPresigningClient

    Erro AmazonPollyPresigningClient

    E/AndroidRuntime( 7816): java.lang.NoSuchFieldError: No instance field timeOffset of type I in class Lcom/amazonaws/services/polly/AmazonPollyPresigningClient; or its superclasses (declaration of 'com.amazonaws.services.polly.AmazonPollyPresigningClient' appears in /data/app/~~C3flFIb3IT4s1qC_Fp6s8A==/br.com.xxxxxxxxxx-WlgnrviUtb6n9P-G7SfaDQ==/base.apk) E/AndroidRuntime( 7816): at com.amazonaws.services.polly.AmazonPollyPresigningClient.getPresignedSynthesizeSpeechUrl(AmazonPollyPresigningClient.java:196) E/AndroidRuntime( 7816): at io.robrichardson.aws_polly.AwsPollyPlugin$onMethodCall$1$1.invokeSuspend(AwsPollyPlugin.kt:85) E/AndroidRuntime( 7816): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/AndroidRuntime( 7816): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/AndroidRuntime( 7816): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) E/AndroidRuntime( 7816): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) E/AndroidRuntime( 7816): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) E/AndroidRuntime( 7816): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) I/Process ( 7816): Sending signal. PID: 7816 SIG: 9

    opened by egler321 0
Owner
null
Dart Code Generator for generating mapper classes

Smartstruct - Dart bean mappings - the easy nullsafe way! Code generator for generating type-safe mappers in dart, inspired by https://mapstruct.org/

Nils 28 Nov 29, 2022
A set of flutter formatters for text and input fields

A set of formatters for text and input fields. Not only it can format a phone number but also automatically detect a country dial code and the name of the country. It also can apply formatting for currencies e.g. you need to convert 100000 into a USD currency value representation.

Konstantin Serov 215 Dec 12, 2022
This package wraps Airtime, Sms, and Voice call from Africa's Talking APIs.

This package wraps some functionalities from Africa's Talking API The functionalities implemented are; Sms send message fetch messages generate checko

Eddie Genius 7 May 31, 2022
An http request client, which supports Manageable Requests Cancellation, Request Policy (Timeout and Retry), Easier Multipart Requests, etc.

A wrapper around Dart's http package, which supports Manageable Requests Cancellation, Request Policy (Timeout and Retry), Easier Multipart Requests, Error Handling, etc.

Iandi Santulus 5 Oct 10, 2021
A simple flexible API wrapper for coinbase commerce API. Totally unofficial.

coinbase_commerce A dart library that connects to interact with the Coinbase Commerce API. Enables projects to connect seamlessly to coinbase and rece

Onuoha Obinna 3 Oct 17, 2021
A Dart package which supports checking if a current package is up-to-date.

pub_updater A Dart package which enables checking whether packages are up to date and supports updating them. Intended for use in CLIs for prompting u

Very Good Open Source 47 Oct 27, 2022
🚀The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time.

Flutter Gen Zeplin Extension ?? The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time. ⬇ 1.1k Getti

NAVER 49 Oct 12, 2022
Future based HTTP client for the Dart and Flutter

Uno Future based HTTP client for the Dart and Flutter. Uno, inspired by Axios, bringing a simple and robust experience to the crossplatform apps in Fl

Flutterando 56 Dec 16, 2022
A JMAP client library in Dart to make JMAP method calls and process the responses

JMAP Dart client A JMAP client library to make JMAP method calls and process the responses. We most notably use it to write the TMail Flutter applicat

LINAGORA 18 Dec 19, 2022
A pure Dart implementation of the Pusher Channels Client

pusher_channels is a pure Dart pusher channels client. This client is work in progress and it is unstable. Usage A simple usage example: import 'packa

Indaband 7 Nov 6, 2022