tts.picovoice#

Description#

This TTS plugin enables you to render text as audio using Picovoice’s (still experimental) Orca TTS engine.

Take a look at platypush.plugins.assistant.picovoice.AssistantPicovoicePlugin for details on how to sign up for a Picovoice account and get the API key.

Also note that using the TTS features requires you to select Orca from the list of products available for your account on the Picovoice console.

Configuration#

tts.picovoice:
  # [Optional]
  # Picovoice access key. If it's not specified here,
  # then it must be specified on the configuration of
  # `AssistantPicovoicePlugin <https://docs.platypush.tech/platypush/plugins/assistant.picovoice.html#platypush.plugins.assistant.picovoice.AssistantPicovoicePlugin>`_.
  # access_key:   # type=Optional[str]

  # [Optional]
  # Path of the TTS model file (default: use the default
  # English model).
  # model_path:   # type=Optional[str]

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

Dependencies#

pip

pip install sounddevice numpy pvorca

Alpine

apk add ffmpeg py3-numpy

Debian

apt install ffmpeg python3-numpy

Fedora

yum install ffmpeg python-numpy

Arch Linux

pacman -S ffmpeg python-numpy python-sounddevice

Actions#

Module reference#

class platypush.plugins.tts.picovoice.TextConversionUtils[source]#

Bases: object

Utility class to convert text to a format that is supported by the Orca TTS engine.

This pre-processing step is necessary until the issue is fixed: Picovoice/orca#10.

__init__()#
class platypush.plugins.tts.picovoice.TtsPicovoicePlugin(access_key: str | None = None, model_path: str | None = None, **kwargs)[source]#

Bases: TtsPlugin

This TTS plugin enables you to render text as audio using Picovoice’s (still experimental) Orca TTS engine.

Take a look at platypush.plugins.assistant.picovoice.AssistantPicovoicePlugin for details on how to sign up for a Picovoice account and get the API key.

Also note that using the TTS features requires you to select Orca from the list of products available for your account on the Picovoice console.

__init__(access_key: str | None = None, model_path: str | None = None, **kwargs)[source]#
Parameters:
say(text: str, *_, output_file: str | None = None, speech_rate: float | None = None, model_path: str | None = None, **__)[source]#

Say some text.

Parameters:
  • text – Text to say.

  • output_file – If set, save the audio to the specified file. Otherwise play it.

  • speech_rate – Speech rate (default: None).

  • model_path – Path of the TTS model file (default: use the default configured model).

stop()[source]#

Stop the currently playing audio.