tts.mimic3#
Description#
TTS plugin that uses the Mimic3 webserver provided by Mycroft as a text-to-speech engine.
Warning
Mycroft AI was dissolved in early 2024, and Mimic3 is no longer actively maintained. See the archived Mycroft CEO update and the community confirmation.
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_deviceandoutput_volume.output_deviceaccepts a PortAudio/sounddevice device index, PortAudio/sounddevice device name, or PulseAudio/PipeWire sink name (requirespactl).output_volumeis 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 ffmpeg portaudio-dev py3-numpy
Debian
apt install python3-numpy ffmpeg portaudio19-dev
Fedora
yum install ffmpeg portaudio-devel python-numpy
Arch Linux
pacman -S ffmpeg portaudio python-numpy python-sounddevice
Actions#
Module reference#
- class platypush.plugins.tts.mimic3.TtsMimic3Plugin(server_url: str, voice: str = 'en_US/vctk_low', **kwargs)[source]#
Bases:
TtsPluginTTS plugin that uses the Mimic3 webserver provided by Mycroft as a text-to-speech engine.
Warning
Mycroft AI was dissolved in early 2024, and Mimic3 is no longer actively maintained. See the archived Mycroft CEO update and the community confirmation.
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 throughvoices().kwargs – Extra arguments to be passed to the
platypush.plugins.tts.TtsPluginconstructor, includingoutput_deviceandoutput_volume.output_deviceaccepts a PortAudio/sounddevice device index, PortAudio/sounddevice device name, or PulseAudio/PipeWire sink name (requirespactl).output_volumeis 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_urloverride.voice – Default
voiceoverride.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_urloverride.- 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" } ]