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'

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

Dependencies#

pip

pip install sounddevice numpy

Alpine

apk add ffmpeg portaudio-dev py3-numpy

Debian

apt install ffmpeg portaudio19-dev python3-numpy

Fedora

yum install ffmpeg python-numpy portaudio-devel

Arch Linux

pacman -S ffmpeg python-numpy python-sounddevice portaudio

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().

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"
  }
]