首页 > 解决方案 > Google Cloud Speech to Text API 停止工作

问题描述

我为我正在进行的一个项目注册了 Google Cloud Speech to Text API。今天早上,我能够成功地将语音转换为文本。晚上,我恢复了工作,突然间,它停止了工作。它不需要任何输入,并且在关键字中断时,我收到以下消息。我不知道为什么它突然决定不工作。我重新启动了笔记本电脑,以为是麦克风问题。然后,我下载了代码并重新运行,但没有积极的结果。以下是我收到的消息。

Traceback (most recent call last):
File "/Users/ajayshah/Downloads/s2t.py", line 174, in <module>
 main()
File "/Users/ajayshah/Downloads/s2t.py", line 167, in main
 responses = client.streaming_recognize(streaming_config, requests)
File "/Users/ajayshah/opt/miniconda3/lib/python3.9/site-packages/google/cloud/speech_v1/helpers.py", line 81, in streaming_recognize
 return super(SpeechHelpers, self).streaming_recognize(
File "/Users/ajayshah/opt/miniconda3/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/client.py", line 605, in streaming_recognize
  response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
File "/Users/ajayshah/opt/miniconda3/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 142, in __call__
  return wrapped_func(*args, **kwargs)
File "/Users/ajayshah/opt/miniconda3/lib/python3.9/site-packages/google/api_core/retry.py", line 283, in retry_wrapped_func
  return retry_target(
File "/Users/ajayshah/opt/miniconda3/lib/python3.9/site-packages/google/api_core/retry.py", line 218, in retry_target
  time.sleep(sleep)
KeyboardInterrupt

标签: google-cloud-platformgoogle-cloud-speechgoogle-speech-to-text-api

解决方案


推荐阅读