- 查询现有语音包信息:脚本
import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
print("Voice:")
print(" - ID: %s" % voice.id)
print(" - Name: %s" % voice.name)
print(" - Languages: %s" % voice.languages)
print(" - Gender: %s" % voice.gender)
print(" - Age: %s" % voice.age)
python执行结果
- 在本地cmd终端执行regedit查看注册表
呼应上了!!!
-
接下来去官网下载语音包https://www.microsoft.com/en-us/download/details.aspx?id=27224
下载TTS包,SR包属于语音转文本!!! -
将下载的.msi文件双击就可以在注册表中发现了
位置是不一样的,需要将语音包放到HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices
路径下 -
修改语音包路径
以语音包ES_Herena包为例,如图点击语音包 右键->>导出,文件名随意起
- 修改ES_Herena.reg文件
将所有Speech Server\v11.0
换成Speech
保存!!!然后双击文件(忽略报错)
-
再次中断运行
regedit
打开注册表
大功告成!!! -
再执行python脚本查看pyttsx3调用的语音包