External APIs

Amazon Polly – Text-to-Speech

Turn text into lifelike speech using deep learning
Back to BLOCKS

About Amazon Polly – Text-to-Speech

Amazon Polly supports dozens of languages and a wide selection of natural-sounding male and female voices. When you send text to Amazon Polly's API, it returns the audio to your application as a stream so you can play the voices immediately. Amazon Polly also supports lexicons and SSML tags which enable you to control aspects of speech, such as pronunciation, volume, pitch, speed rate, etc.

Amazon Polly is priced at $4.00 per 1 million characters for speech or Speech Marks requests. You can cache and replay the generated speech at no additional cost. It's easy to get started with the Amazon Polly Free Tier, which includes 5 million characters per month for speech or Speech Marks requests, starting from your first speech request for 12 months.

Try it Now
Categories:
External APIs External APIs
External APIs
External APIs
Bots & AI
Bots & AI
Chat & Social
Chat & Social
Last Updated:
20180319 at 01:19:46
Author:
PubNub
Additional Links:
Amazon Polly

Walkthrough:

Begin by adding the AWS keys to the vault storage by using the MY SECRETS feature from within the blocks editor. The block will need the AWS_access_key and AWS_secret_key values.

This PubNub Functions listens for all chats and allows to get audio from text in private chats.

To trigger text-to-speech conversion, event payload should contain 'polly' field in it with following keys:
    - location - name of key in event payload, which contain data for polly
    - voice - identifier of voice which should be used to read text. By default set to: 'Joanna'
    - format - generated audio file format. By default set to: 'mp3'

Input:

chatEngineInstsance.emit('message', {
    text: 'hello!',
    polly: {
      voice: 'Joanna',
      format: 'mp3',
      location: 'text'
    }
});

Output:

chatEngineInstsance.on('message', (payload) => {
    // will contain the payload with Amazon Polly data
    console.log(payload.data.polly_sound)
});

Similar BLOCKS

Amazon Comprehend - Discover insights and relationships in text Icon Amazon Comprehend - Discover insights and relationships in text Use natural language processing (NLP) to extract insights about the content of documents without the... External APIs BLOCKS Details Subcategory Bots & AI BLOCKS Details Subcategory Chat & Social BLOCKS Details Subcategory Amazon Translate – Natural and fluent language translation Icon Amazon Translate – Natural and fluent language translation Fast, high-quality, and affordable neural machine translation service. External APIs BLOCKS Details Subcategory Bots & AI BLOCKS Details Subcategory Chat & Social BLOCKS Details Subcategory