# Cloud Speech-to-Text V2 API - Class Google::Cloud::Speech::V2::RecognitionConfig (v1.8.0)

1.8.0 (latest) 1.7.1 1.6.0 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.1 0.16.0 0.15.0 0.14.0 0.13.1 0.12.0 0.11.0 0.10.0 0.9.2 0.8.0 0.7.0 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::RecognitionConfig.

Provides information to the Recognizer that specifies how to process the
recognition request.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #adaptation

    def adaptation() -> ::Google::Cloud::Speech::V2::SpeechAdaptation

**Returns**

- ([::Google::Cloud::Speech::V2::SpeechAdaptation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-SpeechAdaptation)) --- Speech adaptation context that weights recognizer predictions for specific words and phrases.

### #adaptation=

    def adaptation=(value) -> ::Google::Cloud::Speech::V2::SpeechAdaptation

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::SpeechAdaptation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-SpeechAdaptation)) --- Speech adaptation context that weights recognizer predictions for specific words and phrases.
**Returns**

- ([::Google::Cloud::Speech::V2::SpeechAdaptation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-SpeechAdaptation)) --- Speech adaptation context that weights recognizer predictions for specific words and phrases.

### #auto_decoding_config

    def auto_decoding_config() -> ::Google::Cloud::Speech::V2::AutoDetectDecodingConfig

**Returns**

- ([::Google::Cloud::Speech::V2::AutoDetectDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-AutoDetectDecodingConfig)) --- Automatically detect decoding parameters. Preferred for supported formats.


  Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #auto_decoding_config=

    def auto_decoding_config=(value) -> ::Google::Cloud::Speech::V2::AutoDetectDecodingConfig

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::AutoDetectDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-AutoDetectDecodingConfig)) --- Automatically detect decoding parameters. Preferred for supported formats.


  Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Speech::V2::AutoDetectDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-AutoDetectDecodingConfig)) --- Automatically detect decoding parameters. Preferred for supported formats.


  Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #denoiser_config

    def denoiser_config() -> ::Google::Cloud::Speech::V2::DenoiserConfig

**Returns**

- ([::Google::Cloud::Speech::V2::DenoiserConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DenoiserConfig)) --- Optional. Optional denoiser config. May not be supported for all models and may have no effect.

### #denoiser_config=

    def denoiser_config=(value) -> ::Google::Cloud::Speech::V2::DenoiserConfig

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::DenoiserConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DenoiserConfig)) --- Optional. Optional denoiser config. May not be supported for all models and may have no effect.
**Returns**

- ([::Google::Cloud::Speech::V2::DenoiserConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DenoiserConfig)) --- Optional. Optional denoiser config. May not be supported for all models and may have no effect.

### #explicit_decoding_config

    def explicit_decoding_config() -> ::Google::Cloud::Speech::V2::ExplicitDecodingConfig

**Returns**

- ([::Google::Cloud::Speech::V2::ExplicitDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ExplicitDecodingConfig)) --- Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw).


  Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #explicit_decoding_config=

    def explicit_decoding_config=(value) -> ::Google::Cloud::Speech::V2::ExplicitDecodingConfig

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::ExplicitDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ExplicitDecodingConfig)) --- Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw).


  Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Speech::V2::ExplicitDecodingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ExplicitDecodingConfig)) --- Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw).


  Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #features

    def features() -> ::Google::Cloud::Speech::V2::RecognitionFeatures

**Returns**

- ([::Google::Cloud::Speech::V2::RecognitionFeatures](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionFeatures)) --- Speech recognition features to enable.

### #features=

    def features=(value) -> ::Google::Cloud::Speech::V2::RecognitionFeatures

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::RecognitionFeatures](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionFeatures)) --- Speech recognition features to enable.
**Returns**

- ([::Google::Cloud::Speech::V2::RecognitionFeatures](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionFeatures)) --- Speech recognition features to enable.

### #language_codes

    def language_codes() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US".


  Supported languages for each model are listed in the [Table of Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).

  If additional languages are provided, recognition result will contain
  recognition in the most likely language detected. The recognition result
  will include the language tag of the language detected in the audio.

### #language_codes=

    def language_codes=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US".


  Supported languages for each model are listed in the [Table of Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).

  If additional languages are provided, recognition result will contain
  recognition in the most likely language detected. The recognition result
  will include the language tag of the language detected in the audio.
**Returns**

- (::Array\<::String\>) --- Optional. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US".


  Supported languages for each model are listed in the [Table of Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).

  If additional languages are provided, recognition result will contain
  recognition in the most likely language detected. The recognition result
  will include the language tag of the language detected in the audio.

### #model

    def model() -> ::String

**Returns**

- (::String) --- Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

  Guidance for choosing which model to use can be found in the [Transcription
  Models
  Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
  and the models supported in each region can be found in the [Table Of
  Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).

### #model=

    def model=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.


  Guidance for choosing which model to use can be found in the [Transcription
  Models
  Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
  and the models supported in each region can be found in the [Table Of
  Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
**Returns**

- (::String) --- Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

  Guidance for choosing which model to use can be found in the [Transcription
  Models
  Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
  and the models supported in each region can be found in the [Table Of
  Supported
  Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).

### #transcript_normalization

    def transcript_normalization() -> ::Google::Cloud::Speech::V2::TranscriptNormalization

**Returns**

- ([::Google::Cloud::Speech::V2::TranscriptNormalization](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranscriptNormalization)) --- Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability \> 0.8) and final transcripts.

### #transcript_normalization=

    def transcript_normalization=(value) -> ::Google::Cloud::Speech::V2::TranscriptNormalization

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::TranscriptNormalization](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranscriptNormalization)) --- Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability \> 0.8) and final transcripts.
**Returns**

- ([::Google::Cloud::Speech::V2::TranscriptNormalization](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranscriptNormalization)) --- Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability \> 0.8) and final transcripts.

### #translation_config

    def translation_config() -> ::Google::Cloud::Speech::V2::TranslationConfig

**Returns**

- ([::Google::Cloud::Speech::V2::TranslationConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranslationConfig)) --- Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.

### #translation_config=

    def translation_config=(value) -> ::Google::Cloud::Speech::V2::TranslationConfig

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::TranslationConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranslationConfig)) --- Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.
**Returns**

- ([::Google::Cloud::Speech::V2::TranslationConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-TranslationConfig)) --- Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.