mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-21 07:14:18 +02:00
Allow a voice to be selected by language name
This allows the -V option on the command line to be a language name.
This commit is contained in:
parent
c1ad891f2e
commit
ee099174d8
1 changed files with 7 additions and 0 deletions
7
espeak.c
7
espeak.c
|
|
@ -119,8 +119,15 @@ static espeak_ERROR set_rate(struct synth_t *s, int rate,
|
|||
static espeak_ERROR set_voice(struct synth_t *s, char *voice)
|
||||
{
|
||||
espeak_ERROR rc;
|
||||
espeak_VOICE voice_select;
|
||||
|
||||
rc = espeak_SetVoiceByName(voice);
|
||||
if (rc != EE_OK)
|
||||
{
|
||||
memset(&voice_select, 0, sizeof(voice_select));
|
||||
voice_select.languages = voice;
|
||||
rc = espeak_SetVoiceByProperties(&voice_select);
|
||||
}
|
||||
if (rc == EE_OK)
|
||||
strcpy(s->voice, voice);
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue