pyttsx3在说话时tkinter文本
我想要同步的pyttsx3和tkinter-text。我的意思是,我想看看我在字幕之类的文字中讲的是 但是我无法处理。当它不在一段时间内循环时。你们是否知道如何在循环循环中同步进行同步?感谢您的帮助。
with sr.Microphone() as source:
while True:
r.adjust_for_ambient_noise(source, duration=1)
voice = r.listen(source)
text_punk = r.recognize_google(voice, language="en-US")
text_punk = text_punk.lower()
punk_screen = "You---> " + text_punk
txt.insert(END, "\n" + punk_screen)
if text_punk != '':
test=testpy.Testing()
res = test.response(text_punk)
txt.insert(END, "\n" + 'Bot---> ' + res)
talk(res)
I want pyttsx3 and tkinter-text go synchronically. I mean, I want to see what I told in a text like the subtitles
However I could not manage that. It is possible when it is not in a while loop.... but when I use it in while loop it shows the the whole dialogue after the speech is done. Do you guys have any idea how to make them go synchronically when in a while loop? Thank you for your help.
with sr.Microphone() as source:
while True:
r.adjust_for_ambient_noise(source, duration=1)
voice = r.listen(source)
text_punk = r.recognize_google(voice, language="en-US")
text_punk = text_punk.lower()
punk_screen = "You---> " + text_punk
txt.insert(END, "\n" + punk_screen)
if text_punk != '':
test=testpy.Testing()
res = test.response(text_punk)
txt.insert(END, "\n" + 'Bot---> ' + res)
talk(res)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论