RapidWareTech / pyttsx

Cross-platform text-to-speech wrapper
Other
370 stars 134 forks source link

IndexError: list index out of range #67

Closed KC2016 closed 4 years ago

KC2016 commented 4 years ago

Hi,

I am facing an index error because it is producing just 5 items in "voices". Any idea of how can we fix this?

CODE: engine = pyttsx3.init() voices = engine.getProperty('voices')
engine.setProperty('voice', voices[10].id)

ERROR: IndexError: list index out of range

when I print voices: [<pyttsx3.voice.Voice object at 0x000001A76764EE88>, <pyttsx3.voice.Voice object at 0x000001A76781A2C8>, <pyttsx3.voice.Voice object at 0x000001A76478B108>, <pyttsx3.voice.Voice object at 0x000001A76478B148>, <pyttsx3.voice.Voice object at 0x000001A7678CDE08>]