From d9a0224466189d0fe1d46f21d586fa8a1a58c687 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 30 Dec 2022 02:25:50 -0800 Subject: Bugfix: regions truncate correctly at page boundaries Boards whose size is an even multiple of CHARS_PER_SYNC would lose the entire last region. * Attempt to fix runaway memory usage of GUI text frames, but this needs more work --- Scripts/transcribe.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Scripts/transcribe.py') diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py index f90867a..8491e4d 100644 --- a/Scripts/transcribe.py +++ b/Scripts/transcribe.py @@ -280,16 +280,17 @@ def transcribeAudio(audio_state, model): words = ''.join(c for c in text.lower() if (c.isalpha() or c == " ")).split() + old_text = audio_state.text + + audio_state.text = string_matcher.matchStrings(audio_state.text, + text, window_size = 25) + now = time.time() print("Transcription ({} seconds): {}".format( now - last_transcribe_time, audio_state.text)) last_transcribe_time = now - old_text = audio_state.text - - audio_state.text = string_matcher.matchStrings(audio_state.text, - 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