Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Google Cloud Speech-to-Text V2 StreamingRecognize CANCELLED when using cmn-Hans-CN #11586

Copy link
Copy link
Closed as not planned
@leikaiwei

Description

@leikaiwei
Issue body actions

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 Ive tried so far:
Confirmed that the same code/config works for ja-JP and en-US.
Tried both cmn-Hans-CN and zh-CNboth 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

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.