Alternate ways of using mimic3 as a general TTS

First of all, thank you for making mimic3 available for anyone to download and install.

I am finding it to be a very useful way of checking my writing by having it read back what I have written. Mimic3 is a clear improvement for this over mimic1, and a huge improvement over the default TTS software that comes with the orca screen reader in ubuntu.

I haven’t tried to integrate mimic3 with the orca screen reader, so maybe this is already possible, but making this possible would be a great addition for visually impaired users. I imagine that mimic3 would also be good enough for reading ebooks aloud with the right interface software.

In case anyone finds this useful, I installed mimic3 on my laptop as follows:

I am using an old version of Ubuntu, so first I had to install python3.7:

% sudo apt-get install libpython3.7 libpython3.7-dev libpython3.7-minimal libpython3.7-stdlib python3.7 python3.7-dev python3.7-minimal python3.7-venv

Next, in order to avoid messing up the system installation of python, I installed virtualenv so I could isolate mimic3 in a separate environment:

% pip3 install virtualenv

I created an environment for mimic3 called “speech” under ~/.virtualenvs:

% cd ~/.virtualenvs
% virtualenv -p python3.7 speech

Then activated the new environment:

% source ~/.virtualenvs/speech/bin/activate

Then installed mimic3 in the above “speech” environment:

% source ~/.virtualenvs/speech/bin/activate
% pip install mycroft-plugin-tts-mimic3[all]

Checked whether the text-to-speech engine worked:

% echo "Hello world" | ~/.virtualenvs/speech/bin/mimic3 --interactive

Downloaded other english voices:

% mimic3-download 'en_US/*'

There doesn’t seem to be any option for speaking an entire document, so instead I now pipe my text documents into mimic3. This works, except that if text is broken up by new-lines, mimic3 pauses at each new-line, even if this is in the middle of a sentence. It also quits entirely the first time it encounters an empty line. To work-around these issues I now pipe text into mimic3 via a simple awk one-liner, which replaces most newline characters with single spaces, except at the end of sentences (identified by the presence of an ending quote or a period), and removes blank lines that would otherwise abort mimic3.

% cat text | awk '{printf("%s ", $0); if($0 ~ /[.”"'\''][\t ]*$/) printf("\n")}' | ~/.virtualenvs/speech/bin/mimic3 --interactive --voice en_US/vctk_low

A minor issue that I’ve noticed is that the ellipsis character “…” seems to be ignored by mimic3. I would expect it to render it as a pause.

Thank you again for this great peice of software.

1 Like