summaryrefslogtreecommitdiffstats
path: root/generate_utils.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-10-27 16:00:22 -0700
committeryum <yum.food.vr@gmail.com>2022-10-27 16:00:22 -0700
commitfd7ea2f72a486888c30726a2482fcc1f7fce9378 (patch)
treecae0ee99fca59d65062074a546c3975404f7ad89 /generate_utils.py
parenteefa14c431efa4e3bc16cafbcb004e41622c2411 (diff)
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.
Diffstat (limited to 'generate_utils.py')
-rw-r--r--generate_utils.py12
1 files changed, 11 insertions, 1 deletions
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)