我在我的语音助手项目中使用了speech_recognition
模块和googlespeech-to-text-api,它正在工作,但是当软件监听时,我的麦克风没有反应。它只是等待,7-8秒后,它会打印出我说的任何内容(可能是关于googleapi服务)。我想在说话的时候制作一些实时的图形,比如像googleassistant或Siri这样的声波。我可以用PyQt
或其他模块来实现这个功能吗?我将在使用PyQt5
生成GUI的项目中使用此助手。你知道吗
注:对不起,我的英语不好
我找不到任何关于这个的教程。你知道吗
import speech_recognition as sr
import playsound
r = sr.Recognizer()
while True:
with sr.Microphone() as source:
print("Bi Şeyler De")
audio = r.listen(source)
try:
text = r.recognize_google(audio, language='tr-tr')
print(text,"Dedin")
if(text == "Merhaba"):
playsound.playsound('C:/Users/BERKGILLER/Desktop/merhaba.mp3', True)
except:
print("Try Again")
动画不需要是波浪,但我更喜欢它们。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐