Litle try statement change
This commit is contained in:
parent
d530980b0e
commit
7007253072
1 changed files with 8 additions and 8 deletions
|
@ -88,15 +88,15 @@ class GoogleVoiceClient(object):
|
||||||
self.speech_client = speech.SpeechClient()
|
self.speech_client = speech.SpeechClient()
|
||||||
|
|
||||||
while not self.toBeShutdown:
|
while not self.toBeShutdown:
|
||||||
try:
|
config = types.RecognitionConfig(
|
||||||
config = types.RecognitionConfig(
|
encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
|
||||||
encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
|
sample_rate_hertz=self.src_rate,
|
||||||
sample_rate_hertz=self.src_rate,
|
language_code=self.language_code)
|
||||||
language_code=self.language_code)
|
self.streaming_config = types.StreamingRecognitionConfig(
|
||||||
self.streaming_config = types.StreamingRecognitionConfig(
|
config=config,
|
||||||
config=config,
|
interim_results=True)
|
||||||
interim_results=True)
|
|
||||||
|
|
||||||
|
try:
|
||||||
self.logger.log(LOG_BS,"wait for Google Voice")
|
self.logger.log(LOG_BS,"wait for Google Voice")
|
||||||
if not self.isRunning.wait(timeout=1):
|
if not self.isRunning.wait(timeout=1):
|
||||||
continue # re-ceck toBeShutdown
|
continue # re-ceck toBeShutdown
|
||||||
|
|
Loading…
Reference in a new issue