[Speech-to-Text V2] StreamingRecognize is cancelled automatically

Hello.

I’m using StreamingRecognize methods of Speech-to-Text API V2 to achieve realtime continuous recognition from android device mic.(actually I’m using flutter.)
It can recognize mic audio in about first 60 seconds, but after that, it is cancelled automatically.
The streamingRecognizeResponse is below.

streamingRecognizeResponse: [
0: {
speechEventOffset: "0s"
status: {
code: 1
message: "Stream cancelled."
}}]

Also, The flutter message is below.

E/flutter (11663): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: gRPC Error (code: 1, codeName: CANCELLED, message: The operation was cancelled., details: [], rawResponse: null, trailers: {})

Does anyone know why this happens?

1 Like

I believe it has something to do with limits as mentioned here.

" Each StreamingRecognize session is considered a single request even though it includes multiple frames of StreamingRecognizeRequest audio within the stream."

“Requests and/or attempts at audio processing in excess of these limits will produce an error.”

1 Like