mbrola: Report error when loading an mbrola voice fails

Otherwise espeak_SetVoiceByName returns EE_OK even if the mbrola voice
file could not be loaded and thus setting the voice actually failed.
This commit is contained in:
Samuel Thibault
2021-10-16 22:40:55 +02:00
parent 7e5457f91e
commit 572fe31c1b
+4 -1
View File
@@ -889,8 +889,11 @@ voice_t *LoadVoice(const char *vname, int control)
name2[0] = 0;
sscanf(p, "%s %s %d", name1, name2, &srate);
espeak_ng_STATUS status = LoadMbrolaTable(name1, name2, &srate);
if (status != ENS_OK)
if (status != ENS_OK) {
espeak_ng_PrintStatusCodeMessage(status, stderr, NULL);
fclose(f_voice);
return NULL;
}
else
voice->samplerate = srate;
}