summaryrefslogtreecommitdiffstats
path: root/Scripts/transcribe.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-12-30 02:25:50 -0800
committeryum <yum.food.vr@gmail.com>2022-12-30 02:33:07 -0800
commitd9a0224466189d0fe1d46f21d586fa8a1a58c687 (patch)
tree3431bad18d46b7bdbad91caa508cb65f859f0276 /Scripts/transcribe.py
parent7bc6ee5f7f163b35e9de0a368406978d144be5c5 (diff)
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
Diffstat (limited to 'Scripts/transcribe.py')
-rw-r--r--Scripts/transcribe.py9
1 files changed, 5 insertions, 4 deletions
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.