[espeak-ng:master] reported: sluggish speech interruption #github
email@example.com Integration <espeak-ng@...>
[espeak-ng:master] New Comment on Issue #172 sluggish speech interruption
A couple quick points.
There are two places where espeak-ng handles stop requests. One is in close_stream, the other is at the bottom of the main loop in say_thread. As far as I can tell, the one in close_stream is rarely or never exercised. So I patched fifo.c to call audio_object_flush in say_thread.
Second, in speech.c, audio_object_flush gets called in espeak_ng_Cancel. This call happens in a thread other than say_thread, which is the one doing the audio handling. pcaudiolib isn't guaranteed to be threadsafe, so I don't think we can call audio_object_flush there at all. What is that going to do to responsiveness?
There are two branches on my fork https://github.com/CMB/espeak-ng. One is stoprequest, which adds audio_object_flush to say_thread. The other branch is named threadsafe, and it has a patch to remove the flush call from speech.c as well as the stop request patch.