GoogleCloudPlatform / GoogleCloudPlatform/java-docs-samples

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

Đang mở
#8,950 5 bình luận 0 reaction 1 người được giao Được giao cho @ssvir Xem trên GitHub
priority: p2 samples type: question
Ngôn ngữ chính
Java
Star
1.9k
Fork
2.9k
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
17

Mô tả

## 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.