GoogleCloudPlatform / GoogleCloudPlatform/java-docs-samples

InfiniteStreamRecognize - io.grpc.StatusRuntimeException: CANCELLED: Failed to read message when EnableVoiceActivityEvents is true

Ouverte
#8,950 5 commentaires 0 réactions 1 personne assignée Assignée à @ssvir Voir sur GitHub
priority: p2 samples type: question
Langage dominant
Java
Étoiles
1.9k
Forks
2.9k
Merge moyen
3 j 3 h
PR mergées (30 j)
17

Description

## In which file did you encounter the issue?
https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/speech/src/main/java/com/example/speech/InfiniteStreamRecognize.java

## Did you change the file? If so, how?
Added enable voice activity event option and set audio channel count to 1

RecognitionConfig recognitionConfig =
RecognitionConfig.newBuilder()
.setEncoding(RecognitionConfig.AudioEncoding.LINEAR16)
.setLanguageCode(languageCode)
.setSampleRateHertz(16000)
**.setAudioChannelCount(1)**
.build();

StreamingRecognitionConfig streamingRecognitionConfig =
StreamingRecognitionConfig.newBuilder()
.setConfig(recognitionConfig)
.setInterimResults(true)
**.setEnableVoiceActivityEvents(true)
.setVoiceActivityTimeout(VoiceActivityTimeout.newBuilder()
.setSpeechStartTimeout(Duration.newBuilder().setSeconds(15L))
)**
.build();

## Describe the issue
After I receive the event SPEECH_ACTIVITY_BEGIN I get the CancelledException: Failed to read message.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.