From abdaa7ce215086bf1070d6093731cd35df866cbb Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 30 Dec 2022 00:01:28 -0800 Subject: Fine-tune transcription Bump up recording window to 28 seconds. This helps a lot with long-form transcription tasks, s.a. transcribing an audiobook. We should expose this as a parameter, since at 10s the transcription delay is typically 300ms, while at 28s it's typically 1.1-1.2s. --- Scripts/transcribe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Scripts/transcribe.py') diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py index 37a8407..21bb4ba 100644 --- a/Scripts/transcribe.py +++ b/Scripts/transcribe.py @@ -35,7 +35,7 @@ class AudioState: # The maximum length that recordAudio() will put into frames before it # starts dropping from the start. - self.MAX_LENGTH_S = 10 + self.MAX_LENGTH_S = 28 self.MAX_LENGTH_S_WHISPER = 30 # The minimum length that recordAudio() will wait for before saving audio. self.MIN_LENGTH_S = 1 @@ -283,7 +283,7 @@ def transcribeAudio(audio_state, model): old_text = audio_state.text audio_state.text = string_matcher.matchStrings(audio_state.text, - text, window_size = 20) + text, window_size = 25) if old_text != audio_state.text: # We think the user said something, so reset the amount of # time we sleep between transcriptions to the minimum. -- cgit v1.2.3