2 Star 26 Fork 1

cold/基于深度学习的噪声抑制与语音识别系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
alg_tts.py 853 Bytes
一键复制 编辑 原始数据 按行查看 历史
cold 提交于 2022-03-09 22:36 . [first]
import pyttsx3
def init(rate=125, volume=1.0, voice='zh'):
global engine
engine = pyttsx3.init() # object creation
""" RATE"""
rate = engine.getProperty('rate') # getting details of current speaking rate
print (rate) #printing current voice rate
engine.setProperty('rate', rate) # setting up new voice rate
"""VOLUME"""
volume = engine.getProperty('volume')
print (volume)
engine.setProperty('volume',volume)
"""VOICE"""
voices = engine.getProperty('voices')
engine.setProperty('voice', voice)
def ttsSpeak(text):
global engine
engine.say(text)
engine.runAndWait()
engine.stop()
def ttsSaveToFile(text, filename):
global engine
"""Saving Voice to a file"""
engine.save_to_file(text, filename)
engine.runAndWait()
engine.stop()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/feeling-cool/speech-recognition-system.git
git@gitee.com:feeling-cool/speech-recognition-system.git
feeling-cool
speech-recognition-system
基于深度学习的噪声抑制与语音识别系统
master

搜索帮助