From ae9ac5ba5942447f47d8d996d2d340381e730c33 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 23 Nov 2022 12:24:07 -0800 Subject: Tweak speech indicator Use a single indicator with 3 states: 1. green: actively speaking 2. orange: waiting for paging 3. red: up-to-date Use slightly nicer colors. --- transcribe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'transcribe.py') diff --git a/transcribe.py b/transcribe.py index b316014..48a97ba 100644 --- a/transcribe.py +++ b/transcribe.py @@ -288,8 +288,9 @@ def sendAudio(audio_state): audio_state.transcribe_lock.acquire() text = audio_state.committed_text + " " + audio_state.text - is_paging = not osc_ctrl.sendMessageLazy(audio_state.osc_client, text, + ret = osc_ctrl.sendMessageLazy(audio_state.osc_client, text, audio_state.tx_state) + is_paging = (ret == osc_ctrl.SEND_MSG_LAZY_SENT_NON_EMPTY) osc_ctrl.indicatePaging(audio_state.osc_client, is_paging) audio_state.transcribe_lock.release() @@ -301,12 +302,15 @@ def readControllerInput(audio_state): RECORD_STATE = 0 PAUSE_STATE = 1 state = PAUSE_STATE + osc_ctrl.indicateSpeech(audio_state.osc_client, False) + osc_ctrl.indicatePaging(audio_state.osc_client, False) while audio_state.run_app == True: time.sleep(0.05) event = steamvr.pollButtonPress(session) if event == steamvr.EVENT_RISING_EDGE: + print("event get") if state == RECORD_STATE: state = PAUSE_STATE osc_ctrl.indicateSpeech(audio_state.osc_client, False) -- cgit v1.2.3