"Robert D. Crawford" <rdc1x@comcast.net> writes:
> In the .asoundrc file, without the patch applied, if point is on the
> first line and I use C-n to scroll down to line 20 to 25 it takes about
> 4 seconds for the speech to catch up and the line to be spoken. With
> the parch applied it takes about 8 seconds.
There's a TCL procedure named tts_sync_state which is called fairly often.
tts_sync_state calls other TCL procedures. In turn, those procedures call
out to functions from the ESpeak library.
Those library calls are fairly expensive in terms of
CPU time. Often, tts_sync_state is called, but the state of the TTS engine
hasn't changed. It's an expensive no-op.
The reason that tts_sync_state takes longer after my patch is that I fixed
some of the procedures that it uses. Before yesterday's patch,
tts_sync_state often terminated prematurely, due to errors in its callees.
The procedures called by tts_sync_state need to be a bit
smarter. Only call out to C functions when the state of the TTS engine
has actually changed.
So here's another patch. This one should improve the responsiveness
of the ESpeak server. The responsiveness is good enough that I haven't
resorted to using another TTS server during the past few hours.
This doesn't fix the stutter from word echo. I still don't know what causes
that.
Thank you for your helpful comments regarding my last patch!
-- Chris