Browse Source

init phrase_count=1; need to count the first buffer that triggered the phrase

Martin 9 năm trước cách đây
mục cha
commit
2e5b83a955
1 tập tin đã thay đổi với 1 bổ sung và 1 xóa
  1. 1 1
      speech_recognition/__init__.py

+ 1 - 1
speech_recognition/__init__.py

@@ -552,7 +552,7 @@ class Recognizer(AudioSource):
                 # logging.debug('Waiting for start of phrase (energy: %i; energy threshold: %i)', energy, self.energy_threshold)
 
             # read audio input until the phrase ends
-            pause_count, phrase_count = 0, 0
+            pause_count, phrase_count = 0, 1
             phrase_start_time = elapsed_time
             while True:
                 # handle phrase being too long by cutting off the audio