Giter VIP home page Giter VIP logo

amazon-polly-playground's Introduction

  ▄███████▄  ▄██████▄   ▄█        ▄█       ▄██   ▄   
  ███    ███ ███    ███ ███       ███       ███   ██▄ 
  ███    ███ ███    ███ ███       ███       ███▄▄▄███ 
  ███    ███ ███    ███ ███       ███       ▀▀▀▀▀▀███ 
▀█████████▀  ███    ███ ███       ███       ▄██   ███ 
  ███        ███    ███ ███       ███       ███   ███ 
  ███        ███    ███ ███▌    ▄ ███▌    ▄ ███   ███ 
 ▄████▀       ▀██████▀  █████▄▄██ █████▄▄██  ▀█████▀  
                        ▀         ▀                    

What is this?

This is a playground project to test the text to speech engine from Amazon (Polly). The code needs active AWS credentials that are allowed to use Amazon Polly. It will request the generation of an mp3 (or pcm) stream that can be used to play or write the stream/file. If you write an mp3 file to the disk it is recommended to use mpg213 to play the file.

Installation

  • Create your normal node.js/TypeScript project
  • AWS credentials with permission to run Polly should be stored under: ~/.aws/credentials (otherwise the code needs to be altered).
[default]
aws_access_key_id = <YOUR_ACCESS_KEY_ID>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>

Just run npm install and use VS Code to launch App.ts

npm install

Optional: If you want to play a mp3 file (headless) it is recommend to install mpg123

sudo apt install mpg123
sudo apt pacman -S mpg123

How to run

Just run App.ts and comment / uncomment the funtctions you prefer to have. Use following command to run an mp3 file quietly:

mpg123 -q speech.mp3

Known issues

  • The first part of the sentence might be swallowed when playing the pcm stream by using speaker.

Release History

v0.1.1

  • Additional information in the readme file.

v0.1.0

  • Initial commit.

amazon-polly-playground's People

Contributors

mopore avatar

Watchers

 avatar

amazon-polly-playground's Issues

Migrate to new JavaScript API version

(node:25732) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use node --trace-warnings ... to show where the warning was created)

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.