Yannick Weiss

Amazon Polly – Text to Speech

You can use Amazon Polly to process 5 million characters per month at no charge. After that, you pay $0.000004 per character, or about $0.004 per minute of generated audio.

Setup

  1. Install AWS Cli
  2. Run aws configure and fillt it out with access keys from your credentials
  3. Use eu-west-1 or us-east-1

Using it

aws polly synthesize-speech \
  --output-format mp3 --voice-id Brian \
  --text "Hello my name is Brian." \
  brian.mp3
afplay brian.mp3

Custom text-to-speech service for OS X

  1. Open automator
  2. Create new service
  3. Add “Run Shell Script”, with pass input as argument
/usr/local/bin/aws polly synthesize-speech 
--output-format mp3 
--voice-id Brian 
--text "$@" ~/brian.mp3;afplay 
~/brian.mp3; rm ~/brian.mp3

You can stop it with killall afplay.