Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Speech V1 Streaming VoiceActivityTimeout not respected

cc22
New Member

Hi, I'm following the tutorial here: https://cloud.google.com/speech-to-text/docs/samples/speech-transcribe-streaming-mic?hl=en 

This is working, but I want to add a voice_activity_timeout to my StreamingRecognitionConfig as noted here: https://cloud.google.com/python/docs/reference/speech/latest/google.cloud.speech_v1.types.StreamingR...

I'm trying to add a delay with speech_end_timeout, but it's not respected. It just closes the stream immediately after detecting anything that is marked with is_final, no matter what I set the speech_end_timeout to be. Without voice_activity_timeout, it just does not close the stream, but everything else is the same.

 

    config = speech.RecognitionConfig(
        encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,
        sample_rate_hertz=RATE,
        language_code=language_code,
    )

    timeout = Duration(seconds=5)

    streaming_config = speech.StreamingRecognitionConfig(
        config=config, interim_results=True,
        enable_voice_activity_events=True,
        voice_activity_timeout=speech.StreamingRecognitionConfig.VoiceActivityTimeout(
            speech_end_timeout=timeout
        )
    )

 

Thanks in advance. 

0 1 753
1 REPLY 1