소스 검색

speech input: enfore min energy threshold of 400

Martin 10 년 전
부모
커밋
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):