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.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |