Просмотр исходного кода

speech input: enfore min energy threshold of 400

Martin 10 лет назад
Родитель
Сommit
2ad05a0c62
1 измененных файлов с 2 добавлено и 0 удалено
  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):