You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm trying to learn Python here
and I'm doing it in pycharm in Windows 10
My first script I'm trying to learn
is speech recognition
Everything seems to be working okay
except for this one error I get
Class 'object' does not define 'getitem', so the '[]' operator cannot be used on its instances
which I do not understand
Here is my code
import speech_recognition as sr
import pyttsx3
listener = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id) <----is referring to this
engine.say('say, How can I help you.')
engine.runAndWait()
If I comment it out the error will go away but I'm left with a male voice
this is the only error I have and I don't understand it
The text was updated successfully, but these errors were encountered:
So I'm trying to learn Python here
and I'm doing it in pycharm in Windows 10
My first script I'm trying to learn
is speech recognition
Everything seems to be working okay
except for this one error I get
Class 'object' does not define 'getitem', so the '[]' operator cannot be used on its instances
which I do not understand
Here is my code
import speech_recognition as sr
import pyttsx3
listener = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id) <----is referring to this
engine.say('say, How can I help you.')
engine.runAndWait()
If I comment it out the error will go away but I'm left with a male voice
this is the only error I have and I don't understand it
The text was updated successfully, but these errors were encountered: