mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-09 09:19:09 +02:00
moved flush processing into main loop
This patch from Kirk Reiser attempts to increase responsiveness by moving the flush processing into the main loop.
This commit is contained in:
parent
564db7981e
commit
d2d763b36b
1 changed files with 11 additions and 0 deletions
11
softsynth.c
11
softsynth.c
|
|
@ -139,6 +139,7 @@ void main_loop (struct synth_t *s)
|
|||
fd_set set;
|
||||
struct timeval tv;
|
||||
int i;
|
||||
int j;
|
||||
ssize_t length;
|
||||
char buf[maxBufferSize];
|
||||
|
||||
|
|
@ -167,6 +168,16 @@ void main_loop (struct synth_t *s)
|
|||
perror("Read from softsynth failed");
|
||||
break;
|
||||
}
|
||||
for(i = length; i > 0; i--)
|
||||
if (*(buf+i) == 0x18) { /* synth flush char. */
|
||||
queue_clear();
|
||||
stop_speech();
|
||||
j = length-i;
|
||||
for(length = 0; length < j; length++)
|
||||
*(buf+length) = *(buf+i++);
|
||||
*(buf+length) = 0;
|
||||
break;
|
||||
}
|
||||
*(buf+length) = 0;
|
||||
process_buffer (s, buf, length);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue