tts.google#

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

Bases: TtsPlugin

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: str | None = None, gender: str = 'FEMALE', credentials_file: str = '~/.credentials/platypush/google/platypush-tts.json', **kwargs)[source]#
Parameters:
say(text: str, language: str | None = None, voice: str | None = None, gender: str | None = None, player_args: dict | None = 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.