Closed as not planned
Closed as not planned
Copy link
Description
Question:
I’m using Google Cloud Speech-to-Text V2 in an Android (Java) app. With languageCode
set to "ja-JP"
or "en-US"
, streaming recognition works perfectly. As soon as I switch only the language code to "cmn-Hans-CN"
, the call fails immediately with a CANCELLED error.
Environment & Config:
- Model:
chirp_2
- Endpoint:
us-central1-speech.googleapis.com:443
- SDK: com.google.cloud:speech-v2:latest
- Platform: Android (Java)
- Platform: io.grpc:grpc-okhttp:1.72.0
Relevant code snippet:
// Build recognition config
RecognitionConfig config = RecognitionConfig.newBuilder()
.setModel("chirp_2")
.setLanguageCode("cmn-Hans-CN") // ← fails here
.build();
StreamingRecognitionConfig streamingConfig =
StreamingRecognitionConfig.newBuilder()
.setConfig(config)
.build();
// Start streaming
try (SpeechClient client = SpeechClient.create(
SpeechSettings.newBuilder()
.setEndpoint("us-central1-speech.googleapis.com:443")
.build())) {
ClientStream<StreamingRecognizeRequest> stream =
client.streamingRecognizeCallable()
.splitCall(responseObserver);
// First request with config
stream.send(StreamingRecognizeRequest.newBuilder()
.setStreamingConfig(streamingConfig)
.build());
// Then send audio data...
} catch (Exception e) {
Log.e("SpeechTest", "Streaming failed", e);
}
Error log:
`com.google.api.gax.rpc.CancelledException: io.grpc.StatusRuntimeException: CANCELLED: The operation was cancelled.
at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:…)
at com.google.cloud.speech.v2.StreamingRecognizeClient.streamingRecognizeCallable(StreamingRecognizeClient.java:…)
…
05-14 16:42:40.052 26220 26279 E MyApp: com.google.api.gax.rpc.CancelledException: io.grpc.StatusRuntimeException: CANCELLED: The operation was cancelled.
`
What I’ve tried so far:
Confirmed that the same code/config works for ja-JP and en-US.
Tried both cmn-Hans-CN and zh-CN—both cancel immediately.
Verified network connectivity and valid credentials.
Question:
Is there an additional setting or limitation when using Simplified Chinese (cmn-Hans-CN) with the chirp_2 model?
How can I get streaming recognition working for Simplified Chinese?
Any pointers or troubleshooting steps would be greatly appreciated!
Metadata
Metadata
Assignees
Labels
Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.