Question: Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code:

```
import pyttsx as pt
from pyttsx import voice
engine = pt.init()
voices = engine.getProperty('voices')
#engine.setProperty('gender', 'female') # also does not work
engine.setProperty('female', voice.Voice.gender) #not even
engine.setProperty('female', voice.gender) #does not work
engine.setProperty('voice', voices[4].id)
engine.say("Hello World")
engine.runAndWait()

class Voice(object):
    def __init__(self, id, name=None, languages=[], gender=None, age=None):
        self.id = id
        self.name = name
        self.languages = languages
        self.gender = gender
        self.age = age

```

Answer: 
This is a simpler solution:

```
engine = pyttsx.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)

```
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')`
This will definitely work. 0 for male and 1 for female.