diff --git a/src/libespeak-ng/speak_lib.c b/src/libespeak-ng/speak_lib.c index 2d296daa..6ff5fd60 100644 --- a/src/libespeak-ng/speak_lib.c +++ b/src/libespeak-ng/speak_lib.c @@ -393,7 +393,7 @@ static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text, out_ptr = outbuf; out_end = &outbuf[outbuf_size]; event_list_ix = 0; - WavegenFill(0); + WavegenFill(); length = (out_ptr - outbuf)/2; count_samples += length; diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 3213b61c..ac8816bf 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -471,7 +471,7 @@ int WavegenCloseSound(); int WavegenInitSound(); void WavegenInit(int rate, int wavemult_fact); float polint(float xa[], float ya[], int n, float x); -int WavegenFill(int fill_zeros); +int WavegenFill(); void MarkerEvent(int type, unsigned int char_position, int value, int value2, unsigned char *out_ptr); extern unsigned char *wavefile_data; diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index e85ff949..11da802c 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -393,7 +393,7 @@ static int WaveCallback(const void *inputBuffer, void *outputBuffer, event_list_ix = 0; - result = WavegenFill(1); + result = WavegenFill(); // copy from the outbut buffer into the portaudio buffer if (result && (out_ptr > out_end2)) @@ -1530,7 +1530,7 @@ void Write4Bytes(FILE *f, int value) } } -int WavegenFill2(int fill_zeros) +int WavegenFill2() { // Pick up next wavegen commands from the queue // return: 0 output buffer has been filled @@ -1551,11 +1551,6 @@ int WavegenFill2(int fill_zeros) if (resume == 1) return 0; // not yet finished } - - if (fill_zeros) { - while (out_ptr < out_end) - *out_ptr++ = 0; - } return 1; // queue empty, close sound channel } @@ -1677,15 +1672,14 @@ static int SpeedUp(short *outbuf, int length_in, int length_out, int end_of_text #endif // Call WavegenFill2, and then speed up the output samples. -int WavegenFill(int fill_zeros) +int WavegenFill() { int finished; unsigned char *p_start; p_start = out_ptr; - // fill_zeros is ignored. It is now done in the portaudio callback - finished = WavegenFill2(0); + finished = WavegenFill2(); #if HAVE_SONIC_H if (sonicSpeed > 1.0) { diff --git a/src/speak-ng.c b/src/speak-ng.c index 559ff282..09982d19 100644 --- a/src/speak-ng.c +++ b/src/speak-ng.c @@ -258,7 +258,7 @@ static int WavegenFile(void) out_ptr = out_start = wav_outbuf; out_end = wav_outbuf + sizeof(wav_outbuf); - finished = WavegenFill(0); + finished = WavegenFill(); if (quiet) return finished;