import speech_recognition as sr
import sys
import winsound
def speech_listen():
r = sr.Recognizer()
audio = ""
with sr.Microphone() as source:
print("")
print("Listening...")
audio = r.listen(source, phrase_time_limit=15)
print("Processing...")
try:
u_said = r.recognize_google(audio, language='en-US')
print(f"(●) {u_said}")
print("Processing...")
return u_said
except:
print("Awaiting command.")
return 0