Prechádzať zdrojové kódy

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

Martin 9 rokov pred
rodič
commit
2e5b83a955
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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