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', **kwargs)[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)

__init__(language: str = 'en-US', voice: Optional[str] = None, gender: str = 'FEMALE', credentials_file: str = '~/.credentials/platypush/google/platypush-tts.json', **kwargs)[source]
Parameters
say(text: str, language: Optional[str] = None, voice: Optional[str] = None, gender: Optional[str] = None, player_args: Optional[dict] = None)[source]

Say a phrase.

Parameters
  • text – Text to say.

  • language – Language code override.

  • voice – Voice type override.

  • gender – Gender override.

  • player_args – Optional arguments that should be passed to the player plugin’s platypush.plugins.media.MediaPlugin.play() method.