| src/libespeak-ng/intonation.c \ | src/libespeak-ng/intonation.c \ | ||||
| src/libespeak-ng/numbers.c \ | src/libespeak-ng/numbers.c \ | ||||
| src/libespeak-ng/readclause.c \ | src/libespeak-ng/readclause.c \ | ||||
| src/libespeak-ng/phoneme.c \ | |||||
| src/libespeak-ng/phonemelist.c \ | src/libespeak-ng/phonemelist.c \ | ||||
| src/libespeak-ng/setlengths.c \ | src/libespeak-ng/setlengths.c \ | ||||
| src/libespeak-ng/spect.c \ | src/libespeak-ng/spect.c \ |
| ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */ | ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */ | ||||
| ENS_GROUP_ESPEAK_NG = 0x10000000, /* eSpeak NG error codes. */ | ENS_GROUP_ESPEAK_NG = 0x10000000, /* eSpeak NG error codes. */ | ||||
| /* eSpeak NG 1.49.0 */ | |||||
| ENS_OK = 0, | ENS_OK = 0, | ||||
| ENS_COMPILE_ERROR = 0x100001FF, | ENS_COMPILE_ERROR = 0x100001FF, | ||||
| ENS_VERSION_MISMATCH = 0x100002FF, | ENS_VERSION_MISMATCH = 0x100002FF, | ||||
| ENS_NO_SPECT_FRAMES = 0x10000CFF, | ENS_NO_SPECT_FRAMES = 0x10000CFF, | ||||
| ENS_EMPTY_PHONEME_MANIFEST = 0x10000DFF, | ENS_EMPTY_PHONEME_MANIFEST = 0x10000DFF, | ||||
| ENS_SPEECH_STOPPED = 0x10000EFF, | ENS_SPEECH_STOPPED = 0x10000EFF, | ||||
| /* eSpeak NG 1.49.2 */ | |||||
| ENS_UNKNOWN_PHONEME_FEATURE = 0x10000FFF, | |||||
| } espeak_ng_STATUS; | } espeak_ng_STATUS; | ||||
| typedef enum { | typedef enum { |
| continue; | continue; | ||||
| } | } | ||||
| if (phoneme_add_feature(phoneme_out, item_string, NULL) == ENS_OK) | |||||
| continue; | |||||
| switch (item_type) | switch (item_type) | ||||
| { | { | ||||
| case tPHONEME_TYPE: | case tPHONEME_TYPE: |
| case ENS_EMPTY_PHONEME_MANIFEST: | case ENS_EMPTY_PHONEME_MANIFEST: | ||||
| strncpy0(buffer, "The phoneme manifest file does not contain any phonemes", length); | strncpy0(buffer, "The phoneme manifest file does not contain any phonemes", length); | ||||
| break; | break; | ||||
| case ENS_UNKNOWN_PHONEME_FEATURE: | |||||
| strncpy0(buffer, "The phoneme feature is not recognised", length); | |||||
| break; | |||||
| default: | default: | ||||
| if ((status & ENS_GROUP_MASK) == ENS_GROUP_ERRNO) | if ((status & ENS_GROUP_MASK) == ENS_GROUP_ERRNO) | ||||
| strerror_r(status, buffer, length); | strerror_r(status, buffer, length); |
| /* | |||||
| * Copyright (C) 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 | |||||
| * the Free Software Foundation; either version 3 of the License, or | |||||
| * (at your option) any later version. | |||||
| * | |||||
| * This program is distributed in the hope that it will be useful, | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| * GNU General Public License for more details. | |||||
| * | |||||
| * You should have received a copy of the GNU General Public License | |||||
| * along with this program; if not, see: <http://www.gnu.org/licenses/>. | |||||
| */ | |||||
| #include "config.h" | |||||
| #include <errno.h> | |||||
| #include <espeak-ng/espeak_ng.h> | |||||
| #include <espeak-ng/speak_lib.h> | |||||
| #include "phoneme.h" | |||||
| #include "speech.h" | |||||
| #include "error.h" | |||||
| enum feature_t { | |||||
| inv, // invalid phoneme feature name | |||||
| }; | |||||
| static MNEM_TAB features[] = { | |||||
| { NULL, inv }, | |||||
| }; | |||||
| espeak_ng_STATUS | |||||
| phoneme_add_feature(PHONEME_TAB *phoneme, | |||||
| const char *feature, | |||||
| espeak_ng_ERROR_CONTEXT *context) | |||||
| { | |||||
| if (!phoneme || !feature) return -EINVAL; | |||||
| switch (LookupMnem(features, feature)) | |||||
| { | |||||
| default: | |||||
| return ENS_UNKNOWN_PHONEME_FEATURE; | |||||
| } | |||||
| return ENS_OK; | |||||
| } |
| unsigned char length_mod; // a length_mod group number, used to access length_mod_tab | unsigned char length_mod; // a length_mod group number, used to access length_mod_tab | ||||
| } PHONEME_TAB; | } PHONEME_TAB; | ||||
| espeak_ng_STATUS | |||||
| phoneme_add_feature(PHONEME_TAB *phoneme, | |||||
| const char *feature, | |||||
| espeak_ng_ERROR_CONTEXT *context); | |||||
| // Several phoneme tables may be loaded into memory. phoneme_tab points to | // Several phoneme tables may be loaded into memory. phoneme_tab points to | ||||
| // one for the current voice | // one for the current voice | ||||
| extern int n_phoneme_tab; | extern int n_phoneme_tab; |