import speech_recognition as sr import logging def speechfrommicrophone(): r = sr.Recognizer() mic = sr.Microphone() res=[] with mic as source: