From 89a929fe76e4dbd56436288055366d9416c13e74 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 25 Nov 2022 17:57:42 -0800 Subject: Add on/off sound indicator (local) Now we have a visual and auditory indicator for transcription. The auditory indicator is only heard by the user, and can be used to reset the state of the board prior to displaying. --- transcribe.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'transcribe.py') diff --git a/transcribe.py b/transcribe.py index 48a97ba..f9aee9f 100644 --- a/transcribe.py +++ b/transcribe.py @@ -13,6 +13,9 @@ from pydub import effects as pydub_effects # License: MIT. import pyaudio import numpy as np +# python3 -m pip install playsound==1.2.2 +# License: MIT. +from playsound import playsound import steamvr import string_matcher import sys @@ -314,11 +317,13 @@ def readControllerInput(audio_state): if state == RECORD_STATE: state = PAUSE_STATE osc_ctrl.indicateSpeech(audio_state.osc_client, False) + playsound(os.path.abspath("Sounds/Noise_Off.wav")) audio_state.audio_paused = True elif state == PAUSE_STATE: state = RECORD_STATE osc_ctrl.indicateSpeech(audio_state.osc_client, True) + playsound(os.path.abspath("Sounds/Noise_On.wav")) audio_state.transcribe_lock.acquire() audio_state.audio_lock.acquire() -- cgit v1.2.3