Description: Trigger speech start on final chunk of write When espeak is used with pulseaudio, the last part of a line or other chunk is not spoken because pa_stream_trigger needs to get called to start speech. This is called if the buffer is full and writes are not progressing. However nothing calls this for the last part of what's being spoken. The contract for wave_write on the portaudio side seems to start the stream, so do the same on pulse. This patch takes advantage of the fact that calling pulse_free twice in a row with no write causes a trigger. An alternative but larger change would be to refactor that code out of pulse_free. Author: Sam hartman --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: --- espeak-1.46.02.orig/src/wave_pulse.cpp +++ espeak-1.46.02/src/wave_pulse.cpp @@ -731,6 +731,9 @@ size_t wave_write(void* theHandler, char } pulse_write(aBuffer, bytes_to_write); + //trigger + aTotalFreeMem = pulse_free(); + aTotalFreeMem = pulse_free(); terminate: pthread_mutex_unlock(&pulse_mutex);