From 70072530725393eadb6a2b385a6d4aa8a9257c99 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Sat, 27 Apr 2019 12:15:10 +0200 Subject: [PATCH] Litle try statement change --- hugvey/speech/google.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hugvey/speech/google.py b/hugvey/speech/google.py index fe5d488..f5a006e 100644 --- a/hugvey/speech/google.py +++ b/hugvey/speech/google.py @@ -88,15 +88,15 @@ class GoogleVoiceClient(object): self.speech_client = speech.SpeechClient() while not self.toBeShutdown: + config = types.RecognitionConfig( + encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16, + sample_rate_hertz=self.src_rate, + language_code=self.language_code) + self.streaming_config = types.StreamingRecognitionConfig( + config=config, + interim_results=True) + try: - config = types.RecognitionConfig( - encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16, - sample_rate_hertz=self.src_rate, - language_code=self.language_code) - self.streaming_config = types.StreamingRecognitionConfig( - config=config, - interim_results=True) - self.logger.log(LOG_BS,"wait for Google Voice") if not self.isRunning.wait(timeout=1): continue # re-ceck toBeShutdown