Cannot use mimic3 from Speech Dispatcher

I have installed mimic3 tts. I can use it from command line. I can access it from browser. So it works alone. But if I configure it into Speech Dispatcher, the dispatcher does not restart. Here is the according log:

[Fri Jan 20 15:00:46 2023 : 296216] speechd: Speech Dispatcher Logging to file /run/speech-dispatcher/.cache/speech-dispatcher/log//speech-dispatcher.log
[Fri Jan 20 15:00:46 2023 : 296317] speechd: Configuration has been read from “/etc/speech-dispatcher/speechd.conf”
[Fri Jan 20 15:00:46 2023 : 296392] speechd: Initializing output module mimic3 with binary /usr/lib/speech-dispatcher-modules/mimic3 and configuration /etc/speech-dispatcher/modules/mimic3-generic.conf
[Fri Jan 20 15:00:46 2023 : 296398] speechd: Output module is logging to file /run/speech-dispatcher/.cache/speech-dispatcher/log//mimic3.log
[Fri Jan 20 15:00:46 2023 : 296654] speechd: Module mimic3 loaded.
[Fri Jan 20 15:00:47 2023 : 629280] speechd: Unknown response from output module!
[Fri Jan 20 15:00:47 2023 : 629527] speechd: Unknown response from output module!
[Fri Jan 20 15:00:47 2023 : 629532] speechd: ERROR: Can’t initialize audio in output module, see reason above.
[Fri Jan 20 15:00:47 2023 : 629622] speechd: Speech Dispatcher Logging to file /run/speech-dispatcher/.cache/speech-dispatcher/log//speech-dispatcher.log
[Fri Jan 20 15:00:47 2023 : 629632] speechd: Error [speechd.c:672]:No speech output modules were loaded - aborting…

the mimic3.log is empty

Kubuntu 22.04
Speech Dispatcher v0.11.1-ubuntu2

Could someone help me?

Well, I had further experiments. I found that on the documentation page there is a missing line from the /etc/speech-dispatcher/speechd.conf file:

AddModule “mimic3-generic” “sd_generic” “mimic3-generic.conf”

If I add this line, the

sudo systemctl restart speech-dispatcher

command gives no error message. But there is no sound neither from spd-say, nor from the Calibre read aloud function. The log says no clients connected, stops and unloads everything.

If I give for AudioOutputMethod “pulse” (which is default audio system in my Kubuntu) then speech-dispatcher does not restart, in the log there are:

Sat Feb 4 15:56:57 2023 : 289898] speechd: Reply from output module: |300-Opening sound device failed. Reason: Couldn’t open pulse plugin.
[Sat Feb 4 15:56:57 2023 : 289903] speechd: Error: Module reported error in request from speechd (code 3xx): 300-Opening sound device failed. Reason: Couldn’t open pulse plugin.

Following this tutorial speech dispatcher works with mimic3.

Alas, it did not. I made the post after reading that tutorial and experimenting with the configuration.
Since that time I have upgraded my Linux to the Lunar and now mimic3 does not work even in command line. There is probably some incompability in the new packages.

This forum only allows 2 URLs per post so I’ll refer to the mimic3 documentation

simply as DOCURL

This worked for me:

  1. I installed mimic3 from source (DOCURL#from-source)
  2. Put mimic3 executables on PATH by creating symlinks to the executables in $HOME/.local/bin/
  3. At this point I downloaded some voices (DOCURL#downloading-voices)
  4. Copy /etc/speech-dispatcher/speechd.conf to $HOME/.config/speech-dispatcher/
  5. Edit $HOME/.config/speech-dispatcher/speechd.conf then add at the end:

AddModule “mimic3-generic” “sd_generic” “mimic3-generic.conf”
DefaultModule “mimic3-generic”
DefaultLanguage “en”
DefaultVoiceType “MALE1”
AudioOutputMethod “libao”

  1. Make sure the double-quotes you just pasted within the previous 5 lines are simple ASCII double-quotes. It’s always a problem copying from a web page.
  2. From the mimic3 source code, copy examples/speech-dispatcher/mimic3-generic.conf to $HOME/.config/speech-dispatcher/modules/
  3. At this point, you should be able to use mimic3 from the command line. If you run ‘mimic3-server’ you should be able to hear speech with a command like ‘spd-say testing’
  4. If the previous step (8.) failed, sorry but I can’t help you
  5. If you had success and want mimic3 as a service, follow the steps in DOCURL#systemd-service
  6. No need to enable/start speech-dispatcherd

Hope it helps!

I’m happy to report that it works.
Kubuntu 23.04 (Lunar) Python version (3.11.2-1) was not suitable due to some minor incompatibility. So I installed Anaconda (my computer is already full of giant snakes…) and created a virtual environment for Python 3.9 This is where mimic3 tts works.
Speech Dispatcher version 0.11.4-2. This has a mixed relationship with mimic3. It contains the mimic3-generic module, but it was omitted from the list of the speechd.conf file. After I wrote in the lines also recommended by joaovsilva the module works.
The last problem came from the components of my computer: 3 different playback devices are available in it. With the pavucontrol program, the paplay player had to be assigned to the device on which I wanted to hear the sound.
Now I can make Calibre or Okular read aloud my favourite ebooks.