#coding:utf-8 # pip install pyttsx3 import pyttsx3 as pyttsx text = 'I can because i think i can. 逆境清醒 Life is not all roses.人生并不是康庄大道。' engine = pyttsx.init() engine.say(text) # engine.setProperty('rate', 100) #设置语速 # engine.setProperty('volume',0.6) #设置音量 rate = engine.getProperty('rate') #查看语速 print(f'语速:{rate}') volume = engine.getProperty('volume') #查看音量 print (f'音量:{volume}') engine.runAndWait() engine.stop()
标签:engine,转换成,Python,text,volume,rate,音量,语速,文本 From: https://www.cnblogs.com/boye169/p/17867930.html