Browse Source

Check for ENE_VERSION_MISMATCH from espeak_ng_Initialize.

master
Reece H. Dunn 9 years ago
parent
commit
09d071046a
3 changed files with 11 additions and 10 deletions
  1. 4
    4
      src/espeak-ng.c
  2. 4
    3
      src/libespeak-ng/speak_lib.c
  3. 3
    3
      src/speak-ng.c

+ 4
- 4
src/espeak-ng.c View File

/* /*
* Copyright (C) 2006 to 2013 by Jonathan Duddington * Copyright (C) 2006 to 2013 by Jonathan Duddington
* email: [email protected] * email: [email protected]
* 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 * 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 * it under the terms of the GNU General Public License as published by
espeak_ng_InitializePath(data_path); espeak_ng_InitializePath(data_path);
espeak_ng_STATUS result = espeak_ng_Initialize(); espeak_ng_STATUS result = espeak_ng_Initialize();
if (result != ENS_OK) { 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"); fprintf(stderr, "Wrong version of espeak-data\n");
else
fprintf(stderr, "Failed to load espeak-data\n");
exit(1); exit(1);
} }



+ 4
- 3
src/libespeak-ng/speak_lib.c View File

espeak_ng_InitializePath(path); espeak_ng_InitializePath(path);
espeak_ng_STATUS result = espeak_ng_Initialize(); espeak_ng_STATUS result = espeak_ng_Initialize();
if (result != ENS_OK) { 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"); fprintf(stderr, "Failed to load espeak-data\n");
if ((options & espeakINITIALIZE_DONT_EXIT) == 0) if ((options & espeakINITIALIZE_DONT_EXIT) == 0)
exit(1); exit(1);
} else
fprintf(stderr, "Wrong version of espeak-data (expected 0x%x) at %s\n", version_phdata, path_home);
}
} }


switch (output_type) switch (output_type)

+ 3
- 3
src/speak-ng.c View File

espeak_ng_InitializePath(data_path); espeak_ng_InitializePath(data_path);
espeak_ng_STATUS result = espeak_ng_Initialize(); espeak_ng_STATUS result = espeak_ng_Initialize();
if (result != ENS_OK) { 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); 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); exit(1);
} }



Loading…
Cancel
Save