# Cloud Speech V2 Client - Class RecognitionConfig (2.5.1)

2.5.1 (latest) 2.5.0 2.4.0 2.3.0 2.2.1 2.1.1 2.0.1 1.20.1 1.19.2 1.18.3 1.16.0 1.15.0 1.14.3 1.13.1 1.12.0 1.11.2 1.10.0 1.9.1 1.8.0 1.7.0 Reference documentation and code samples for the Cloud Speech V2 Client class RecognitionConfig.

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

Generated from protobuf message `google.cloud.speech.v2.RecognitionConfig`

## Namespace

Google \\ Cloud \\ Speech \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ auto_decoding_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.AutoDetectDecodingConfig` Automatically detect decoding parameters. Preferred for supported formats. |
| `↳ explicit_decoding_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig` Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw). |
| `↳ model` | `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). |
| `↳ language_codes` | `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. |
| `↳ features` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures` Speech recognition features to enable. |
| `↳ adaptation` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.SpeechAdaptation` Speech adaptation context that weights recognizer predictions for specific words and phrases. |
| `↳ transcript_normalization` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.TranslationConfig` Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models. |
| `↳ denoiser_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.DenoiserConfig` Optional. Optional denoiser config. May not be supported for all models and may have no effect. |

### getAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.AutoDetectDecodingConfig|null` |   |

### hasAutoDecodingConfig

### setAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.AutoDetectDecodingConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig|null` |   |

### hasExplicitDecodingConfig

### setExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getModel

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** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setModel

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).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLanguageCodes

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** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setLanguageCodes

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFeatures

Speech recognition features to enable.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures|null` |   |

### hasFeatures

### clearFeatures

### setFeatures

Speech recognition features to enable.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAdaptation

Speech adaptation context that weights recognizer predictions for specific
words and phrases.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.SpeechAdaptation|null` |   |

### hasAdaptation

### clearAdaptation

### setAdaptation

Speech adaptation context that weights recognizer predictions for specific
words and phrases.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.SpeechAdaptation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTranscriptNormalization

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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.TranscriptNormalization|null` |   |

### hasTranscriptNormalization

### clearTranscriptNormalization

### setTranscriptNormalization

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.TranscriptNormalization` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTranslationConfig

Optional. Optional configuration used to automatically run translation on
the given audio to the desired language for supported models.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.TranslationConfig|null` |   |

### hasTranslationConfig

### clearTranslationConfig

### setTranslationConfig

Optional. Optional configuration used to automatically run translation on
the given audio to the desired language for supported models.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.TranslationConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDenoiserConfig

Optional. Optional denoiser config. May not be supported for all models
and may have no effect.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.DenoiserConfig|null` |   |

### hasDenoiserConfig

### clearDenoiserConfig

### setDenoiserConfig

Optional. Optional denoiser config. May not be supported for all models
and may have no effect.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.DenoiserConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDecodingConfig

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |