forgot return when sentence timout at recording
This commit is contained in:
parent
dbb6ba48ea
commit
bbd211f6be
@ -48,10 +48,14 @@ def record():
|
|||||||
audio = r.listen(source, timeout=2, phrase_time_limit=5)
|
audio = r.listen(source, timeout=2, phrase_time_limit=5)
|
||||||
except sr.WaitTimeoutError:
|
except sr.WaitTimeoutError:
|
||||||
print("Sentence timeout")
|
print("Sentence timeout")
|
||||||
|
return
|
||||||
|
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=sa.WaveObject.from_wave_file(os.getcwd() + "/jarvis" + "/sounds/" + "listened.wav").play).start()
|
target=sa.WaveObject.from_wave_file(os.getcwd() + "/jarvis" + "/sounds/" + "listened.wav").play).start()
|
||||||
server_utils.send_record_to_server(audio.frame_data)
|
|
||||||
|
if audio.frame_data:
|
||||||
|
|
||||||
|
server_utils.send_record_to_server(audio.frame_data)
|
||||||
|
|
||||||
|
|
||||||
def no_voice_input():
|
def no_voice_input():
|
||||||
|
Reference in New Issue
Block a user