赞
踩
plaintextCopy code
pip install pyttsx3
pythonCopy code
import pyttsx3
pythonCopy code
engine = pyttsx3.init()
pythonCopy code
engine.setProperty('rate', 150) # 设置语速为150 engine.setProperty('volume', 0.8) # 设置音量为0.8
pythonCopy code
engine.say("Hello world")
pythonCopy code
engine.runAndWait()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。