platypush.plugins.tts.google

class platypush.plugins.tts.google.TtsGooglePlugin(language: str = 'en-US', voice: Optional[str] = None, gender: str = 'FEMALE', credentials_file: str = '~/.credentials/platypush/google/platypush-tts.json', player_args: Optional[List[str]] = None)[source]

Advanced text-to-speech engine that leverages the Google Cloud TTS API. See https://cloud.google.com/text-to-speech/docs/quickstart-client-libraries#client-libraries-install-python for how to enable the API on your account and get your credentials.

Requires:

  • google-cloud-texttospeech - pip install google-cloud-texttospeech
  • mplayer - see your distribution docs on how to install the mplayer package
__init__(language: str = 'en-US', voice: Optional[str] = None, gender: str = 'FEMALE', credentials_file: str = '~/.credentials/platypush/google/platypush-tts.json', player_args: Optional[List[str]] = None)[source]
Parameters:
say(text: str, language: Optional[str] = None, voice: Optional[str] = None, gender: Optional[str] = None, player_args: Optional[List[str]] = None)[source]

Say a phrase.

Parameters:
  • text – Text to say.
  • language – Language code override.
  • voice – Voice type override.
  • gender – Gender override.
  • player_args – Player args override.