import python_weather
import speech_recognition
import pyttsx3
robot_ear = speech_recognition.Recognizer()
robot_mouth = pyttsx3.init()
robot_brain = ""
with speech_recognition.Microphone() as mic:
print("Tfive: Tôi đang lắng nghe bạn")
audio = robot_ear.listen(mic)
print("Tfive: ...")
try:
you = robot_ear.recognize_google(audio)
except:
you == ""
print("You: " + you)
if you == "":
robot_brain = "Tôi không hiểu bạn nói gì ?"
elif "Weather" in you:
client = python_weather.Client(format=python_weather.IMPERIAL)
print("Robot: " + robot_brain)
(Lỗi 1:IndentationError: unindent does not match any outer indentation level (không Tab)
(Lỗi 2:IndentationError: unexpected indent (Có Tab