mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-15 18:04:26 +00:00
Fix setting the default voice from espeak_SetVoiceByProperties.
This commit is contained in:
+1
-1
@@ -598,7 +598,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (voicename[0] == 0)
|
||||
strcpy(voicename, "en");
|
||||
strcpy(voicename, ESPEAKNG_DEFAULT_VOICE);
|
||||
|
||||
result = espeak_ng_SetVoiceByName(voicename);
|
||||
if (result != ENS_OK) {
|
||||
|
||||
@@ -36,6 +36,8 @@ extern "C"
|
||||
#define ESPEAK_NG_API
|
||||
#endif
|
||||
|
||||
#define ESPEAKNG_DEFAULT_VOICE "en"
|
||||
|
||||
typedef enum {
|
||||
ENS_GROUP_MASK = 0x70000000,
|
||||
ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */
|
||||
|
||||
@@ -544,7 +544,7 @@ voice_t *LoadVoice(const char *vname, int control)
|
||||
return NULL;
|
||||
} else {
|
||||
if (voicename[0] == 0)
|
||||
strcpy(voicename, "en");
|
||||
strcpy(voicename, ESPEAKNG_DEFAULT_VOICE);
|
||||
|
||||
sprintf(path_voices, "%s%cvoices%c", path_home, PATHSEP, PATHSEP);
|
||||
sprintf(buf, "%s%s", path_voices, voicename); // look in the main voices directory
|
||||
@@ -1294,7 +1294,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found)
|
||||
|
||||
if (voice_select2.name == NULL) {
|
||||
if ((voice_select2.name = voice_select2.identifier) == NULL)
|
||||
voice_select2.name = "default";
|
||||
voice_select2.name = ESPEAKNG_DEFAULT_VOICE;
|
||||
}
|
||||
|
||||
strncpy0(buf, voice_select2.name, sizeof(buf));
|
||||
@@ -1321,7 +1321,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found)
|
||||
if (nv == 0) {
|
||||
// no matching voice, choose the default
|
||||
*found = 0;
|
||||
if ((voices[0] = SelectVoiceByName(voices_list, "default")) != NULL)
|
||||
if ((voices[0] = SelectVoiceByName(voices_list, ESPEAKNG_DEFAULT_VOICE)) != NULL)
|
||||
nv = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user