In google-cloud-dotnet VoiceActivityTimeout not working in StreamingRecognizeRequest

55 Views Asked by At

I'm trying to use the VoiceActivityTimeout setting in google-cloud-dotnet Google.Cloud.Speech.V1 package and it doesn't work. The details are as follows.

Submitting a request like this:

streamingCall.WriteAsync(
new StreamingRecognizeRequest()
{
StreamingConfig = new StreamingRecognitionConfig()
{
Config = new RecognitionConfig()
{
Encoding = RecognitionConfig.Types.AudioEncoding.Linear16,
SampleRateHertz = 16000,
LanguageCode = "en",
MaxAlternatives = 1
},
SingleUtterance = true,
InterimResults = true,
EnableVoiceActivityEvents = true,
VoiceActivityTimeout = new VoiceActivityTimeout()
{
SpeechEndTimeout = new Duration { Seconds = 4, Nanos = 4 },
SpeechStartTimeout = new Duration { Seconds = 7, Nanos = 4 }
}
},
});

When starting to stream audio I'm getting both timeout events right at the start of audio streaming: Response: { "speechEventType": "SPEECH_ACTIVITY_TIMEOUT", "speechEventTime": "0s", "requestId": "49..." } Response: { "speechEventType": "END_OF_SINGLE_UTTERANCE", "speechEventTime": "0s", "requestId": "49..." }

Without EnableVoiceActivityEvents/VoiceActivityTimeout set the service works as expected. Any ideas will be greatly appreciated.

0

There are 0 best solutions below