Fix wave file truncation when reading multiline text from stdin or FIFO (line-by-line reading mode).

This commit is contained in:
Reece H. Dunn
2016-08-16 20:55:31 +01:00
parent 3387c0e6ab
commit 8f44217e70
+4 -6
View File
@@ -257,12 +257,7 @@ static int SynthCallback(short *wav, int numsamples, espeak_EVENT *events)
{
char fname[210];
if (quiet) return 0; // -q quiet mode
if (wav == NULL) {
CloseWavFile();
return 0;
}
if (quiet || wav == NULL) return 0;
while (events->type != 0) {
if (events->type == espeakEVENT_SAMPLERATE) {
@@ -731,5 +726,8 @@ int main(int argc, char **argv)
if (f_phonemes_out != stdout)
fclose(f_phonemes_out);
CloseWavFile();
espeak_ng_Terminate();
return 0;
}