mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 14:04:27 +00:00
Check for ENE_VERSION_MISMATCH from espeak_ng_Initialize.
This commit is contained in:
+4
-4
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2006 to 2013 by Jonathan Duddington
|
||||
* email: jonsd@users.sourceforge.net
|
||||
* Copyright (C) 2015 Reece H. Dunn
|
||||
* Copyright (C) 2015-2016 Reece H. Dunn
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -590,10 +590,10 @@ int main(int argc, char **argv)
|
||||
espeak_ng_InitializePath(data_path);
|
||||
espeak_ng_STATUS result = espeak_ng_Initialize();
|
||||
if (result != ENS_OK) {
|
||||
if (result == ENE_READ_ERROR)
|
||||
fprintf(stderr, "Failed to load espeak-data\n");
|
||||
else
|
||||
if (result == ENE_VERSION_MISMATCH)
|
||||
fprintf(stderr, "Wrong version of espeak-data\n");
|
||||
else
|
||||
fprintf(stderr, "Failed to load espeak-data\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -635,12 +635,13 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
|
||||
espeak_ng_InitializePath(path);
|
||||
espeak_ng_STATUS result = espeak_ng_Initialize();
|
||||
if (result != ENS_OK) {
|
||||
if (result == ENE_READ_ERROR) {
|
||||
if (result == ENE_VERSION_MISMATCH)
|
||||
fprintf(stderr, "Wrong version of espeak-data (expected 0x%x) at %s\n", version_phdata, path_home);
|
||||
else {
|
||||
fprintf(stderr, "Failed to load espeak-data\n");
|
||||
if ((options & espeakINITIALIZE_DONT_EXIT) == 0)
|
||||
exit(1);
|
||||
} else
|
||||
fprintf(stderr, "Wrong version of espeak-data (expected 0x%x) at %s\n", version_phdata, path_home);
|
||||
}
|
||||
}
|
||||
|
||||
switch (output_type)
|
||||
|
||||
+3
-3
@@ -577,10 +577,10 @@ int main(int argc, char **argv)
|
||||
espeak_ng_InitializePath(data_path);
|
||||
espeak_ng_STATUS result = espeak_ng_Initialize();
|
||||
if (result != ENS_OK) {
|
||||
if (result == ENE_READ_ERROR)
|
||||
fprintf(stderr, "Failed to load espeak-data\n");
|
||||
else
|
||||
if (result == ENE_VERSION_MISMATCH)
|
||||
fprintf(stderr, "Wrong version of espeak-data (expected 0x%x) at %s\n", version_phdata, path_home);
|
||||
else
|
||||
fprintf(stderr, "Failed to load espeak-data\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user