Amazon Polly gives you high quality Text-to-Speech which allows you create content or augment existing products. 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. With homebrew it is a simple brew install awscli
  3. Run aws configure and fillt it out with access keys from your credentials

Using it

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

You can send a maximum of 6000 characters at once.

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

    1
    2
    3
    4
    5
    
    /usr/local/bin/aws polly synthesize-speech
    --output-format mp3
    --voice-id Brian
    --text "$@" ~/brian.mp3;afplay
    ~/brian.mp3; rm ~/brian.mp3

If it runs amok you can stop it with killall afplay.