Files
spotify-gui/voicecontrol.py
Brandon4466 c18594855e added threading for the lyrics download for speed
added update print to console if updated
2023-02-10 22:57:12 -08:00

19 lines
499 B
Python

import speech_recognition as sr
def recognize(recognizer, audio):
try:
if "magical skip song" in r.recognize_google(audio):
controlNext()
else:
pass
except sr.RequestError as e:
print("Could not request results; {0}".format(e))
except sr.UnknownValueError:
print("Speech not understood")
r = sr.Recognizer()
m = sr.Microphone()
with m as source:
r.adjust_for_ambient_noise(source)
print("Ambient Noise Calibration Complete")