platypush.plugins.tts

class platypush.plugins.tts.TtsPlugin(language='en-gb', media_plugin: Optional[str] = None, player_args: Optional[dict] = None)[source]

Default Text-to-Speech plugin. It leverages Google Translate.

Requires:

__init__(language='en-gb', media_plugin: Optional[str] = None, player_args: Optional[dict] = None)[source]
Parameters
  • language – Language code (default: en-gb).

  • media_plugin

    Media plugin to be used for audio playback. Supported:

    • media.gstreamer

    • media.omxplayer

    • media.mplayer

    • media.mpv

    • media.vlc

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

say(text: str, language: Optional[str] = None, player_args: Optional[dict] = None)[source]

Say some text.

Parameters
  • text – Text to say.

  • language – Language code override.

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