mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-03 14:59:52 +00:00
Don't re-initialize my_audio if espeak_ng_InitializeOutput is called multiple times.
This commit is contained in:
@@ -252,7 +252,8 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE
|
|||||||
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
|
||||||
@@ -886,6 +887,7 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Terminate(void)
|
|||||||
#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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user