mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-15 18:04:26 +00:00
Use the error context API in espeak_ng_CompileDictionary.
This commit is contained in:
+9
-3
@@ -596,17 +596,23 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (flag_compile) {
|
||||
espeak_ng_ERROR_CONTEXT context = NULL;
|
||||
#if defined(PLATFORM_DOS) || defined(PLATFORM_WINDOWS)
|
||||
char path_dsource[sizeof(path_home)+20];
|
||||
strcpy(path_dsource, path_home);
|
||||
path_dsource[strlen(path_home)-11] = 0; // remove "espeak-data" from the end
|
||||
strcat(path_dsource, "dictsource\\");
|
||||
|
||||
espeak_ng_STATUS status = espeak_ng_CompileDictionary(path_dsource, dictionary_name, NULL, flag_compile & 0x1);
|
||||
espeak_ng_STATUS status = espeak_ng_CompileDictionary(path_dsource, dictionary_name, NULL, flag_compile & 0x1, &context);
|
||||
#else
|
||||
espeak_ng_STATUS status = espeak_ng_CompileDictionary(NULL, dictionary_name, NULL, flag_compile & 0x1);
|
||||
espeak_ng_STATUS status = espeak_ng_CompileDictionary(NULL, dictionary_name, NULL, flag_compile & 0x1, &context);
|
||||
#endif
|
||||
return (status == ENS_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
if (status != ENS_OK) {
|
||||
espeak_ng_PrintStatusCodeMessage(status, stderr, context);
|
||||
espeak_ng_ClearErrorContext(&context);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
SetParameter(espeakRATE, speed, 0);
|
||||
|
||||
Reference in New Issue
Block a user