I am working with a python script that is made from the code below that is provided in the google documentation.
Transcribe audio from streaming input | Cloud Speech-to-Text Documentation | Google Cloud
When I add my google cloud credentials and use en-US as my language_code, it works perfectly. I have used it for over an hour straight without any issues. When I change the language_code to any of the following es-MX, es-US, es-VE, I begin to have the same issue. Sometime within 15 seconds to 10 minutes it will fail. It usually fails at the 4 minute mark, because that is what the streaming_limit is set to. It will display the spanish transcription up until the time it fails. I have found if I just speak short sentences, and take a couple second break between them, it wont fail. Its almost like at the 4 minute mark if it can’t process the final few sentences in time, it crashes. Its also weird that it doesn’t do this for english, I have tested this so much over the past 2 weeks with no issue in english.
Below is what google cloud shows online.
NameRequestsErrors (%)Latency, median (ms)Latency, 95% (ms)
Cloud Speech-to-Text API |
21 |
71 |
330,382 |
516,222 |
I usually do not get an error message if it stops working on during a New Stream Request. Below is what it looks like even though spanish is still being spoken.
240000: NEW REQUEST
480000: NEW REQUEST
Here is the error message I am getting inside the application if it fails before the new request. This has only happened 1 time.
Traceback (most recent call last):
File “C:\Users\abc123\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\google\api_core\grpc_helpers.py”, line 112, in next
return next(self._wrapped)
File “C:\Users\abc123\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\grpc_channel.py”, line 543, in next
return self._next()
File “C:\Users\abc123\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\grpc_channel.py”, line 969, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = “Internal error encountered.”
debug_error_string = “UNKNOWN:Error received from peer ipv4:142.250.138.95:443 {grpc_message:“Internal error encountered.”, grpc_status:13, created_time:“2024-10-15T23:56:40.7689232+00:00”}”
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “c:\Users\abc123\Desktop\GoogleCloudTTS\GoogleSST.py”, line 332, in
main()
File “c:\Users\abc123\Desktop\GoogleCloudTTS\GoogleSST.py”, line 317, in main
listen_print_loop(responses, stream)
File “c:\Users\abc123\Desktop\GoogleCloudTTS\GoogleSTT.py”, line 221, in listen_print_loop
for response in responses:
File “C:\Users\abc123\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\google\api_core\grpc_helpers.py”, line 115, in next
raise exceptions.from_grpc_error(exc) from exc