TypeError: setProperty() takes 3 positional arguments but 4 were given error while using in pyttsx3
TypeError: setProperty() takes 3 positional arguments but 4 were given error while using in pyttsx3
Pyttsx3模块错误
当我 运行 这给了我错误。但是我想让女性的声音被主持..我该怎么做
将 speech_recognition 导入为 sr
导入 pyttsx3
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty(voices[1].id,'rate',178)
def speak(text):
engine.say(text)
engine.runAndWait()
speak("Hello welcome to Shimla Bank")
我想这就是你需要的:
egnine.setProperty("voice", voices[1].id)
engine.setProperty("rate", 178)
Pyttsx3模块错误 当我 运行 这给了我错误。但是我想让女性的声音被主持..我该怎么做 将 speech_recognition 导入为 sr 导入 pyttsx3
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty(voices[1].id,'rate',178)
def speak(text):
engine.say(text)
engine.runAndWait()
speak("Hello welcome to Shimla Bank")
我想这就是你需要的:
egnine.setProperty("voice", voices[1].id)
engine.setProperty("rate", 178)