def main():
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
try:
speech_text = r.recognize_google(audio).lower().replace("'", "")
print("Mustani thinks you said '" + speech_text + "'")
except sr.UnknownValueError:
print("Mustani could not understand audio")
except sr.RequestError as e:
print("Could not request results from Google Speech Recognition
service; {0}".format(e))
brain(name,speech_text,city_name, city_code)
评论列表
文章目录