随笔- 310  文章- 1  评论- 0  阅读- 86066 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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()

  

 posted on   boye169  阅读(43)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
历史上的今天:
2022-11-30 linux ls命令详解
2022-11-30 nginx安装及部署
点击右上角即可分享
微信分享提示