我找到了一个可以让你录音的pyttsx分支。https://github.com/hick/pyttsx/tree/master/pyttsx
下面是我的代码:
engine =pyttsx.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id) #change index to change voices
engine.rec('test this out','test.wav')问题是。如果不关闭shell,我就无法打开文件。但是我需要运行更多的代码...例如编码为mp3。
我已经试过engine.stop()了。我从这里看:https://github.com/hick/pyttsx/blob/master/pyttsx/engine.py ..。
发布于 2018-01-05 13:29:30
使用pyttsx3而不是pyttsx:
import pyttsx3
engine = pyttsx3.init()
engine.say('Nice to meet you')
engine.runAndWait()https://stackoverflow.com/questions/43599009
复制相似问题