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 pvorca numpy sounddevice

Alpine

apk add py3-numpy ffmpeg

Debian

apt install python3-numpy ffmpeg

Fedora

yum install python-numpy ffmpeg

Arch Linux

pacman -S python-sounddevice python-numpy ffmpeg

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.