Browse Source

Don't re-initialize my_audio if espeak_ng_InitializeOutput is called multiple times.

master
Reece H. Dunn 8 years ago
parent
commit
9fc2efb1fa
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/libespeak-ng/speech.c

+ 3
- 1
src/libespeak-ng/speech.c View File

out_samplerate = 0; out_samplerate = 0;


#ifdef HAVE_PCAUDIOLIB_AUDIO_H #ifdef HAVE_PCAUDIOLIB_AUDIO_H
my_audio = create_audio_device_object(device, "eSpeak", "Text-to-Speech");
if (my_audio == NULL)
my_audio = create_audio_device_object(device, "eSpeak", "Text-to-Speech");
#endif #endif


// buffer_length is in mS, allocate 2 bytes per sample // buffer_length is in mS, allocate 2 bytes per sample
#ifdef HAVE_PCAUDIOLIB_AUDIO_H #ifdef HAVE_PCAUDIOLIB_AUDIO_H
audio_object_close(my_audio); audio_object_close(my_audio);
audio_object_destroy(my_audio); audio_object_destroy(my_audio);
my_audio = NULL;
#endif #endif
out_samplerate = 0; out_samplerate = 0;
} }

Loading…
Cancel
Save