Hello guys, I have a code where every 5 seconds the skript check if there is any keyword. But I get the error: Speech Recognition failed. I don‘t know why? My Code:
````
s = ui.Switch()
s.frame = (970,1,600,40)
def s_action(sender):
global timestamp
recorder = sound.Recorder('speech.m4a')
recorder.record()
if s.value == True:
while True:
if s.value == False:
break
elif clock2.uhrgedruckt == True:
clock2.uhrgedruckt = False
print('ok')
elif timestamp - time.time() <= -5:
recorder.stop()
result = speech.recognize('speech.m4a', 'de_DE')
if result[0][0] == 'Hallo':
print('Du hast hallo gesagt')
timestamp = time.time()
recorder.record()
else:
print('Fehler')
timestamp = time.time()
recorder.record()
else:
pass
s.action = s_action