tts.mimic3#

Description#

TTS plugin that uses the Mimic3 webserver provided by Mycroft as a text-to-speech engine.

The easiest way to deploy a Mimic3 instance is probably via Docker:

$ mkdir -p "$HOME/.local/share/mycroft/mimic3"
$ chmod a+rwx "$HOME/.local/share/mycroft/mimic3"
$ docker run --rm \
    -p 59125:59125 \
    -v "%h/.local/share/mycroft/mimic3:/home/mimic3/.local/share/mycroft/mimic3" \
    'mycroftai/mimic3'
param kwargs:

Extra arguments to be passed to the TtsPlugin constructor, including output_device and output_volume. output_device accepts a PortAudio/sounddevice device index, PortAudio/sounddevice device name, or PulseAudio/PipeWire sink name (requires pactl). output_volume is a playback volume percentage.

Configuration#

tts.mimic3:
  # [Required]
  # Base URL of the web server that runs the Mimic3 engine.
  server_url:   # type=str

  # [Optional]
  # Default voice to be used (default: ``en_US/vctk_low``).
  # You can get a full list of the voices available on the server
  # through `TtsMimic3Plugin.voices <https://docs.platypush.tech/platypush/plugins/tts.mimic3.html#platypush.plugins.tts.mimic3.TtsMimic3Plugin.voices>`_.
  # voice: en_US/vctk_low  # type=str

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

  # [Optional]
  # Audio output device to use for playback.
  # Supported formats: PortAudio/sounddevice device index,
  # PortAudio/sounddevice device name, or PulseAudio/PipeWire sink name
  # (e.g. ``alsa_output.pci-...``; requires ``pactl``). If specified,
  # it is passed as the ``device`` argument to
  # `SoundPlugin.play <https://docs.platypush.tech/platypush/plugins/sound.html#platypush.plugins.sound.SoundPlugin.play>`_.
  # output_device:   # type=int | str | None

  # [Optional]
  # Playback volume, as a percentage. ``100`` means
  # unchanged, values below ``100`` attenuate, and values above ``100``
  # amplify with clipping in the playback path. It is passed as the
  # ``volume`` argument to `SoundPlugin.play <https://docs.platypush.tech/platypush/plugins/sound.html#platypush.plugins.sound.SoundPlugin.play>`_.
  # output_volume:   # type=float | None

Dependencies#

pip

pip install numpy sounddevice

Alpine

apk add py3-numpy portaudio-dev ffmpeg

Debian

apt install portaudio19-dev python3-numpy ffmpeg

Fedora

yum install python-numpy portaudio-devel ffmpeg

Arch Linux

pacman -S portaudio python-numpy ffmpeg python-sounddevice

Actions#

Module reference#

class platypush.plugins.tts.mimic3.TtsMimic3Plugin(server_url: str, voice: str = 'en_US/vctk_low', **kwargs)[source]#

Bases: TtsPlugin

TTS plugin that uses the Mimic3 webserver provided by Mycroft as a text-to-speech engine.

The easiest way to deploy a Mimic3 instance is probably via Docker:

$ mkdir -p "$HOME/.local/share/mycroft/mimic3"
$ chmod a+rwx "$HOME/.local/share/mycroft/mimic3"
$ docker run --rm \
    -p 59125:59125 \
    -v "%h/.local/share/mycroft/mimic3:/home/mimic3/.local/share/mycroft/mimic3" \
    'mycroftai/mimic3'
__init__(server_url: str, voice: str = 'en_US/vctk_low', **kwargs)[source]#
Parameters:
  • server_url – Base URL of the web server that runs the Mimic3 engine.

  • voice – Default voice to be used (default: en_US/vctk_low). You can get a full list of the voices available on the server through voices().

  • kwargs – Extra arguments to be passed to the platypush.plugins.tts.TtsPlugin constructor, including output_device and output_volume. output_device accepts a PortAudio/sounddevice device index, PortAudio/sounddevice device name, or PulseAudio/PipeWire sink name (requires pactl). output_volume is a playback volume percentage.

say(text: str, *_, server_url: str | None = None, voice: str | None = None, **player_args)[source]#

Say some text.

Parameters:
  • text – Text to say.

  • server_url – Default server_url override.

  • voice – Default voice override.

  • player_args – Extends the additional arguments to be passed to platypush.plugins.sound.SoundPlugin.play() (like volume, duration, channels etc.).

stop()#

Stop the playback.

voices(server_url: str | None = None)[source]#

List the voices available on the server.

Parameters:

server_url – Default server_url override.

Returns:

[
  {
    "aliases": [
      "string"
    ],
    "description": "string",
    "key": "en_UK/apope_low",
    "language": "en_UK",
    "language_english": "Name of the language (in English)",
    "language_native": "Name of the language (in the native language)",
    "name": "apope_low",
    "sample_text": "Some text"
  }
]