From fd7ea2f72a486888c30726a2482fcc1f7fce9378 Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 27 Oct 2022 16:00:22 -0700 Subject: Add fast clear animation The old clear mechanism would write an empty cell in every layer, which would take (0.3 seconds) * (11 layers) == about 3 seconds. The new mechanism drives an animation which overwrites every character slot simultaneously, taking only 0.1 seconds. A nice ~30x speedup. * Fix the transcription exponential backoff logic. Saying new things will reset the delay to the minimum again. * Clearing the board will also reset the transcription delay back to the minimum. * Tune the noise detection minimum to 0.2 instead of 0.1. Speaking softly into the mic seems to fail to exceed the 0.1 threshold pretty often. --- generate_utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'generate_utils.py') diff --git a/generate_utils.py b/generate_utils.py index 68a455b..bf7e6c7 100644 --- a/generate_utils.py +++ b/generate_utils.py @@ -54,6 +54,10 @@ def getSpeechNoiseToggleParam(): def getSpeechNoiseEnableParam(): return "TaSTT_Speech_Noise_Enable" +# When this is set to true, the board clears. +def getClearBoardParam(): + return "TaSTT_Clear_Board" + def getLockWorldParam(): return "TaSTT_Lock_World" @@ -112,9 +116,15 @@ def getShaderParam(which_layer, s0, s1, s2, s3): return getShaderParamByRowCol(row, col) -def getAnimationName(row, col, letter): +# The name of the animation which writes `letter` at a specific position in the +# display. +def getLetterAnimationName(row, col, letter): return "R%02dC%02dL%02d" % (row, col, letter) +# The name of the animation which clears the entire board. +def getClearAnimationName(): + return "TaSTT_Clear_Board" + def getAnimationNameByLayerAndIndex(which_layer, s0, s1, s2, s3, letter): index = getBoardIndex(which_layer, s0, s1, s2, s3) -- cgit v1.2.3