def takecommand(): r = sr.Recognizer() with sr.Microphone() as source: print("listening....") audio = r.record(s