Jelajahi Sumber

speech input: enfore min energy threshold of 400

Martin 10 tahun lalu
induk
melakukan
2ad05a0c62
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  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):