From bbd211f6be523550e0d87bd6489a70a7b11f46e1 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Sat, 28 Aug 2021 16:07:28 +0200 Subject: [PATCH] forgot return when sentence timout at recording --- jarvis/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jarvis/main.py b/jarvis/main.py index 67c5511..1834068 100644 --- a/jarvis/main.py +++ b/jarvis/main.py @@ -48,10 +48,14 @@ def record(): audio = r.listen(source, timeout=2, phrase_time_limit=5) except sr.WaitTimeoutError: print("Sentence timeout") + return threading.Thread( 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():