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 num2words sounddevice

Alpine

apk add ffmpeg py3-numpy portaudio-dev

Debian

apt install ffmpeg python3-numpy portaudio19-dev

Fedora

yum install ffmpeg portaudio-devel python-numpy

Arch Linux

pacman -S ffmpeg python-sounddevice python-numpy portaudio

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.