added threading for the lyrics download for speed
added update print to console if updated
This commit is contained in:
19
voicecontrol.py
Normal file
19
voicecontrol.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user