...
Download the keyfile JSON from the TTS Google Agent https://cloud.google.com/text-to-speech/docs/libraries#setting_up_authentication
Note: the JSON file can be changed in the application at runtime using the
TTSConnector
'sset_tts_key(<path to keyfile>)
method
Choose a voice ID for the text synthesising from https://cloud.google.com/text-to-speech/docs/voices here
the language is automatically inferred from the voice ID
Note: the voice can be changed in the application at runtime using the
TTSConnector
'sset_tts_voice(<voice ID>)
method
...
In order to use the service, you first need to create a TTS Agent. For that, visit https://cloud.google.com/text-to-speech/docs/libraries#setting_up_authentication this page to set up a Google service account and download the JSON keyfile.
Create a service account
log in to the (Google) account you want to use for the TTS agent
Select your project
If a http://dialogflow.cloud.google.com/ Dialogflow agent exists on the same Google Account with a key, select it from your already available projects
Otherwise, if you plan on using Dialogflow, you can create a Dialogflow - restructured agent first
if there are no pre-existing projects, create one using the “Create Project” button
follow Follow the rest of the instructions on https://cloud.google.com/text-to-speech/docs/libraries#setting_up_authenticationsearch here
Search for “text to speech” in the search bar and select “Cloud Text-to-Speech API”
enable the Cloud Text to Speech API by clicking the “Enable” button
you will be asked to set up billing information which you can do by pressing “Enable Billing” > “Create Billing Account” > fill in your information > “Start My Free Trial”.
If you’re using the TTS service for the first time, you will be granted $300 to spend, which should be more than enough for your application.
...
Create a
TTSConnector
instance.set the keyfile and the voice ID in the
TTSConnector
call the connector’s
say_text_to_speech([text])
with the text to be synthesized
Example
See https://bitbucket.org/socialroboticshub/connectors/src/master/python/tts_example.py this for an example usage.
Events
...