Simple voice change

Asked by Damjan

Hi, I'm trying to change the default voice to language of a choice, btw I'm building a custom GTK gui frontend for espeak so I found this framework as an excellent replacement for my os.system executor.

This is the code that I use>
import espeak
spk = espeak
for lang in spk.list_voices():
    if lang.identifier == "mk":
        mk = lang
spk.set_voice(mk.name, "mk")

What I need to know is how to set voice gender, to set a voice gender with the command espeak I use>
espeak -vmk+f1, where f1 is a range from f1 to f4 or m1 to m5.

In the static char>
static char *kwlist[] = {"name", "language", "gender", "age",
  "variant", NULL};
what value does gender need to be, Python says it needs a float, and what's with the age ? - Is age the 1 to 4 range ?

Question information

Language:
English Edit question
Status:
Answered
For:
python-espeak Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Siegfried Gevatter (rainct) said :
#1

Those are the values:
 - gender: None=not specified, 1=male, 2=female
 - age: None=not specified, or an age in years

(But if I run list_voices() on my system all results have gender "1" and age "None", and "espeak --voices" gives the same result.)

By the way, have you seen https://launchpad.net/espeak-gui? Maybe you could join our efforts, I'm open to contributions :).

Revision history for this message
Siegfried Gevatter (rainct) said :
#2

In fact, this wasn't working since there was an error in the code. Gender and age should be parsed as integers, but (as you said) they were being parsed as floats).

This is now fixed in trunk (I'll release a 0.3 tarball soon).

Can you help with this problem?

Provide an answer of your own, or ask Damjan for more information if necessary.

To post a message you must log in.