def OnClicked(self):
r = sr.Recognizer()
with sr.Microphone() as source:
speak.say('Hey I am Listening ')
speak.runAndWait()
audio = r.listen(source)
try:
put=r.recognize_google(audio)
self.displayText(put)
self.textBox.insert('1.2',put)
put=put.lower()
put = put.strip()
#put = re.sub(r'[?|$|.|!]', r'', put)
link=put.split()
events(self,put,link)
except sr.UnknownValueError:
self.displayText("Could not understand audio")
except sr.RequestError as e:
self.displayText("Could not request results; {0}".format(e))
评论列表
文章目录