Browse Source

Look in espeak-ng-data/lang for voices.

This is to support splitting language specification (dictionaries)
from voice specification (phon*).
master
Reece H. Dunn 8 years ago
parent
commit
6eaf1d2ddc
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/libespeak-ng/voices.c

+ 8
- 0
src/libespeak-ng/voices.c View File

@@ -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)

Loading…
Cancel
Save