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
text_to_speech.pl 'welcome to the end of the world' 'welcome.mp3'
first param required, second param of filename optional
* 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:
Non-ASCII character seen before =encoding in '–with-ffplay'. Assuming UTF-8
To install WebService::GoogleAPI::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::GoogleAPI::Client
CPAN shell
perl -MCPAN -e shell install WebService::GoogleAPI::Client
For more information on module installation, please visit the detailed CPAN module installation guide.