summaryrefslogtreecommitdiffstats
path: root/Scripts/transcribe.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-12-22 23:10:37 -0800
committeryum <yum.food.vr@gmail.com>2022-12-24 12:13:07 -0800
commit50d327b83b496085ec91e31100d12f5f60c7d4ac (patch)
tree239431b51e578f2188e6cf4c70ca8905390e72be /Scripts/transcribe.py
parent6f2c1dace46a68620bc61a732a2f43252bd5d3ba (diff)
GUI: expose chars per sync, bytes per char
Users can now control how many characters they send per sync event, as well as the number of bytes used to represent each character. This gives them the power to pick between faster paging and fewer sync params. International users must use 2 bytes per char (at least for now). * package.ps1: don't distribute the gigantic TTF files, just the bitmaps
Diffstat (limited to 'Scripts/transcribe.py')
-rw-r--r--Scripts/transcribe.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py
index e883704..00ab82f 100644
--- a/Scripts/transcribe.py
+++ b/Scripts/transcribe.py
@@ -6,6 +6,7 @@ from datetime import datetime
import os
import osc_ctrl
from functools import partial
+import generate_utils
# python3 -m pip install pyaudio
# License: MIT.
import pyaudio
@@ -400,6 +401,8 @@ if __name__ == "__main__":
parser.add_argument("--mic", type=str, help="Which mic to use. Options: index, focusrite. Default: index")
parser.add_argument("--language", type=str, help="Which language to use. Ex: english, japanese, chinese, french, german.")
parser.add_argument("--model", type=str, help="Which AI model to use. Ex: tiny, base, small, medium")
+ parser.add_argument("--bytes_per_char", type=str, help="The number of bytes to use to represent each character")
+ parser.add_argument("--chars_per_sync", type=str, help="The number of characters to send on each sync event")
args = parser.parse_args()
if not args.mic:
@@ -411,5 +414,11 @@ if __name__ == "__main__":
if not args.model:
args.language = "base"
+ if not args.bytes_per_char or not args.chars_per_sync:
+ print("--bytes_per_char and --chars_per_sync required", file=sys.stderr)
+ sys.exit(1)
+ generate_utils.config.BYTES_PER_CHAR = int(args.bytes_per_char)
+ generate_utils.config.CHARS_PER_SYNC = int(args.chars_per_sync)
+
transcribeLoop(args.mic, args.language, args.model)