我的代码:
import webbrowser as wb
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("speak now")
audio = r.listen(source)
text = r.recognize_google(audio)
try:
if "youtube" in text:
wb.open_new("www.youtube.com")
except sr.UnknownValueError:
print("error")
except sr.RequestError as e:
print("failed".format(e))
我的输出: 现在说
进程已完成,退出代码为0
我的代码根本没有打开web浏览器。有人能修好吗
目前没有回答
相关问题 更多 >
编程相关推荐