Closed itprojects closed 5 years ago
I believe Festival only stops at the next period (.
) after receiving SIGTERM
. But using SIGINT
seems to work now.
Okay, SIGINT
stops instantly when using flatpak-spawn
, but still reads to the end of the sentence when called directly.
Maybe flatpak-spawn
shouldn't be used at all, since not everyone uses flatpak, but it's good for research purposes.
Blocking thread problem?
Do you get the impression that you have to press stop twice, for the program to stop at the nearest '.'?
Why festival? Have you tried espeak
with mbrola
voices, it reads much better. Sometimes ignores superscripts, like a real reader should.
flatpak-spawn
is only use when the a process failed to spawn without it, and then if Flatpak is not used, then it would just do nothing. If there's a better way to handle this I'd very much like to hear it.
Festival in general is a bit hard to kill. Perhaps it's doable via some trick but I'm not an expert in process management.
Originally I wanted to use speech-dispatcher
, but it doesn't have an easy shell API. espeak
has pretty much the same shell interface, and by replacing ['festival', '--tts']
with ['espeak']
in the current TTS code, everything works with espeak
, too.
Is espeak
easier to terminate. Does it stop on the spot?
Try this:
espeak-ng -v mb-en1 -a 100 -g 1 -p 50 -s 160
espeak-ng
is the new espeak
and should have more and longer support life.
You might need to install packages: mbrola mbrola-en1
I've actually only tested with espeak-ng
and not espeak
, and it stops on SIGINT
and works quite well. You can easily test this yourself by replacing the argv ['festival', '--tts']
with ['espeak']
or optionally along with its command line options here: https://github.com/johnfactotum/foliate/blob/07510d70edbe02ee3ecb04dd1bf6159c62f3fd40/src/main.js#L2594
So can we switch to espeak-ng?
In the future it would be great to be able to modify the TTS parameters like speed, pitch voice, etc.
Check the latest commit. TTS is now disabled by default and you can set any command you want in gsettings.
Thanks!
I think this can be closed now because (1) espeak
works, (2) Festival not stopping immediately on SIGINT
or SIGTERM
is probably best dealt with upstream, and (3) if there's a way to kill Festival instantly, it'd easy to write a wrapper script to do just that when receiving SIGINT
, and then set that script as the TTS command.
Starting TTS is easy. Stopping takes some time (several sentences). Is there any way to send a signal to the other process "end now!". Also, maybe add the festival to the debian and Readme.md files.