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 portaudio-dev py3-numpy ffmpeg

Debian

apt install portaudio19-dev python3-numpy ffmpeg

Fedora

yum install portaudio-devel python-numpy ffmpeg

Arch Linux

pacman -S python-numpy python-sounddevice portaudio 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.