Hey guys so I want to use Speech Recognition while streaming a video and want to use alternative language codes. Clearly in the package of streaming recognition on Google Cloud under the RecognitionConfig protocol there is a alternative_language_codes[] parameter which takes a list of up to 3 alternative languages. https://cloud.google.com/speech-to-text/docs/reference/rpc/google.cloud.speech.v1p1beta1#google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
My code is:
second_lang = 'el-GR'
config = types.RecognitionConfig(
encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
sample_rate_hertz=RATE,
language_code=language_code,
alternative_language_codes=[second_lang])
but I get an error:
ValueError: Protocol message RecognitionConfig has no "alternative_language_codes" field.
Any idea what might be wrong?
alternative_language_codes
field. speechV1Beta does. So youre probably not using the Beta version. – Ahmet