[英]Not getting any audio output during Text to speech with Pyttsx3 module on Pycharm
我的 python 版本是 3.7,Pyaudio 版本是 2.7程序在引擎初始化期間完全運行,但我不能將sipas5用於 windows 所以我使用了dummy
import pyttsx3
engine = pyttsx3.init("dummy")
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(text):
print('Rex:' + text)
engine.say(text)
engine.runAndWait()
print("On")
speak("This program is running perfectly")
print("End")
Output
On
Rex:This program is running perfectly
End
Process finished with exit code 0
Dummy 不是語音引擎。 它的 tk 只是測試。 pyttsx3 有 3 種類型。 Sapi5、nsss 和 espeak。 這就是您放入該 init() 中的內容。 這是官方 python package 信息的鏈接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.