From 6eaf1d2ddc30dfb1b490060f274677da54005439 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 4 Feb 2017 16:50:57 +0000 Subject: [PATCH] Look in espeak-ng-data/lang for voices. This is to support splitting language specification (dictionaries) from voice specification (phon*). --- src/libespeak-ng/voices.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index ab74d70f..1d523645 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -545,6 +545,11 @@ voice_t *LoadVoice(const char *vname, int control) sprintf(path_voices, "%s%cvoices%c", path_home, PATHSEP, PATHSEP); sprintf(buf, "%s%s", path_voices, voicename); // look in the main voices directory + + if (GetFileLength(buf) <= 0) { + sprintf(path_voices, "%s%clang%c", path_home, PATHSEP, PATHSEP); + sprintf(buf, "%s%s", path_voices, voicename); // look in the main languages directory + } } f_voice = fopen(buf, "r"); @@ -1570,6 +1575,9 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec) sprintf(path_voices, "%s%cvoices", path_home, PATHSEP); GetVoices(path_voices, strlen(path_voices)+1); + sprintf(path_voices, "%s%clang", path_home, PATHSEP); + GetVoices(path_voices, strlen(path_voices)+1); + voices_list[n_voices_list] = NULL; // voices list terminator espeak_VOICE **new_voices = (espeak_VOICE **)realloc(voices, sizeof(espeak_VOICE *)*(n_voices_list+1)); if (new_voices == NULL)