Ambrose Li

Mimic3, or the state of TTS on Linux

I have a smallish script to check the TV schedule to make announcements when certain programs are aired (for my mom, not for myself), but ever since my Mac essentially died, the quality of the text-to-speech has been abysmal. About a week ago I read about mimic3.‍[Note 1]

I did some work to switch my script’s TTS driver to mimic3 and quality is now comparable to what we have on the Mac or on Android; so far, no issues.

Until today.

While checking my logs today, I noticed my script crashed. On this announcement:

It is now ten fifty-six in the morning. Next at eleven. Cultural Genocide: Canada’s Schools of Shame

And what was the crash?

UnicodeEncodeError: 'utf-8' codec can't encode characters in position 6-8: surrogates not allowed
[23046] Failed to execute script 'mimic3' due to unhandled exception!

I was puzzled. Position 6–8? “now”?

What surrogate?

So I tried to reproduce the error, since everything was logged.

I could not reproduce the error.

And I od -c’d the log. The only non-ASCII characters were the apostrophes.

Looks like mimic3 isn’t that reliable? Or was it Python? Or the Pi? Or was it a case of some-space-particle-struck-the-computer-and-caused-a-random-error?

I’m going to try mimic1 some time; I need mimic1 for pitch support in any case.

Sigh.

Notes

  1. Eben Farnworth, “Text to speech (TTS) on Linux,” October 1, 2021, accessed September 21, 2023, https://​ebenfarnworth​.substack​.com/​p/​text​-to​-speech​-tts​-on​-linux.