python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

Infinite Streaming Not Working with Google Speech-to-Text API v2

Open rodrigoGA opened this issue 7 months ago • 0 comments

I have encountered issues with the implementation of infinite streaming in Google Speech-to-Text API v2, as proposed in the resolved issue #11596. The provided example does not function as expected for continuous streaming. Here are the main problems:

Max Duration Limit: After 5 minutes of streaming, the following error is received:

grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
  status = StatusCode.ABORTED
  details = "Max duration of 5 minutes reached for stream."
  debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.134.42:443 {grpc_message:"Max duration of 5 minutes reached for stream.", grpc_status:10, created_time:"2024-06-10T16:55:08.43835454-03:00"}"
>

Audio Chunk Size Limit: When using smaller models like telephony_short, the stream fails with the following error:

grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
  status = StatusCode.INVALID_ARGUMENT
  details = "Audio chunk can be of a maximum of 25600 bytes. Received audio of 294400 bytes instead."
  debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.133.10:443 {created_time:"2024-06-10T17:01:02.223753051-03:00", grpc_status:3, grpc_message:"Audio chunk can be of a maximum of 25600 bytes. Received audio of 294400 bytes instead."}"
>

Additional Context: The original issue highlighted the need for a functional infinite streaming example for one of the most common use cases of the API. However, the current implementation does not meet the requirements for true infinite streaming due to the aforementioned limitations.

rodrigoGA avatar Jul 19 '24 16:07 rodrigoGA