diff --git a/audiosource.py b/audiosource.py index 848b487..98cc6b2 100644 --- a/audiosource.py +++ b/audiosource.py @@ -51,7 +51,7 @@ class MicrophoneAudioSource(AudioSource): super().__init__() self._recorder = speech_recognition.Recognizer() - self._recorder.energy_threshold = 50 + self._recorder.energy_threshold = 200 # Definitely do this, dynamic energy compensation lowers the energy # threshold dramatically to a point where the SpeechRecognizer diff --git a/transcribe_demo.py b/transcribe_demo.py index 0fb55dc..9ea19b6 100644 --- a/transcribe_demo.py +++ b/transcribe_demo.py @@ -318,9 +318,9 @@ def main(): # Infinite loops are bad for processors, must sleep. Also, limit the anim speed. if diffsize > 30: - sleep(0.01) + sleep(0.0025) else: - sleep(0.05) + sleep(0.0125) except KeyboardInterrupt: break diff --git a/transcriber.py b/transcriber.py index 87a27e3..3402ceb 100644 --- a/transcriber.py +++ b/transcriber.py @@ -7,7 +7,7 @@ recent_phrase_count = 8 phrase_timeout = 1.0 # Higher is less restrictive on what it lets pass through. -no_speech_prob_threshold = 0.15 # 0.15 +no_speech_prob_threshold = 0.05 # 0.15 # Minimum number of seconds before we fire off the model again. min_time_between_updates = 2