Pārlūkot izejas kodu

speech input: enfore min energy threshold of 400

Martin 10 gadi atpakaļ
vecāks
revīzija
2ad05a0c62
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      voice_control/input_sources/google_cloud_speech.py

+ 2 - 0
voice_control/input_sources/google_cloud_speech.py

@@ -20,6 +20,8 @@ class GoogleCloudSpeech(base.InputSource):
         with sr.Microphone() as source:
             self.recognizer.adjust_for_ambient_noise(source)
 
+        self.recognizer.energy_threshold = max(400, self.recognizer.energy_threshold)
+
         output.debug('sr: recognizer initialized, at energy threshold %i.' % self.recognizer.energy_threshold)
 
     def _recognizer_callback(self, recognizer, audio):