From 02a1cfb67bbd67bbaca53de77ce3aad97648427b Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 22 Dec 2022 13:34:05 -0800 Subject: Quick hack: don't exponentially back off when unpaused This fixed some slowness I was seeing when waking up the STT. The right fix is to add interruptible sleeps. Let's fix this soon. --- Scripts/transcribe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py index c72fb9f..e883704 100644 --- a/Scripts/transcribe.py +++ b/Scripts/transcribe.py @@ -237,7 +237,10 @@ def transcribeAudio(audio_state, model): last_transcribe_time = time.time() while audio_state.run_app == True: # Pace this out - time.sleep(audio_state.transcribe_sleep_duration) + if audio_state.audio_paused: + time.sleep(audio_state.transcribe_sleep_duration) + else: + time.sleep(0.05) # Increase sleep time. Code below will set sleep time back to minimum # if a change is detected. -- cgit v1.2.3