The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

text_to_speech.pl

PRE-REQUISITES

assumes gapi.json configuration in working directory with scoped project and user authorization

uses ffplay which is part if ffmpeg to play the mp3 files retrieved through the api

     brew install ffmpeg –with-ffplay

https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize

Scope required for Speech API Beta is https://www.googleapis.com/auth/cloud-platform Assumes that Google Text To Speech API is enabled

See also alternative using gcloud as described at https://cloud.google.com/text-to-speech/docs/quickstart-protocol

USAGE

    text_to_speech.pl 'welcome to the end of the world' 'welcome.mp3'

first param required, second param of filename optional

TODO

* more optional parameters * Selectable voices - https://cloud.google.com/text-to-speech/docs/voices * Check out Google TTS Voice Training Project - https://github.com/google/voice-builder#prerequisites ( Voice Builder: A Tool for Building Text-To-Speech Voices )

1 POD Error

The following errors were encountered while parsing the POD:

Around line 20:

Non-ASCII character seen before =encoding in '–with-ffplay'. Assuming UTF-8