tts#

Description#

Default Text-to-Speech plugin. It leverages Google Translate’s unofficial frontend API.

param player_args:

Additional arguments to be passed to SoundPlugin.play (like volume, duration, channels etc.).

Configuration#

tts:
  # [Optional]
  # Language code (default: ``en-US``).
  # language: en-US

Dependencies#

pip

pip install numpy sounddevice num2words

Alpine

apk add py3-numpy ffmpeg portaudio-dev

Debian

apt install portaudio19-dev python3-numpy ffmpeg

Fedora

yum install python-numpy portaudio-devel ffmpeg

Arch Linux

pacman -S python-numpy portaudio python-sounddevice ffmpeg

Actions#

Module reference#

class platypush.plugins.tts.TtsPlugin(language='en-US', **player_args)[source]#

Bases: Plugin

Default Text-to-Speech plugin. It leverages Google Translate’s unofficial frontend API.

__init__(language='en-US', **player_args)[source]#
Parameters:
say(text: str, language: str | None = None, **player_args)[source]#

Say some text.

Parameters:
stop()[source]#

Stop the playback.