# Cloud Speech V2 Client - Class ExplicitDecodingConfig (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 ExplicitDecodingConfig.

Explicitly specified decoding parameters.

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

## Namespace

Google \\ Cloud \\ Speech \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ encoding` | `int` Required. Encoding of the audio data sent for recognition. |
| `↳ sample_rate_hertz` | `int` Optional. Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000, and 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of resampling). Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. |
| `↳ audio_channel_count` | `int` Optional. Number of channels present in the audio data sent for recognition. Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. The maximum allowed value is 8. |

### getEncoding

Required. Encoding of the audio data sent for recognition.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [AudioEncoding](https://docs-0cloud-0google-0com.linkedin.net.nz/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig.AudioEncoding). |

### setEncoding

Required. Encoding of the audio data sent for recognition.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [AudioEncoding](https://docs-0cloud-0google-0com.linkedin.net.nz/php/docs/reference/cloud-speech/latest/V2.ExplicitDecodingConfig.AudioEncoding). |

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

### getSampleRateHertz

Optional. Sample rate in Hertz of the audio data sent for recognition.

Valid values are: 8000-48000, and 16000 is optimal. For best results, set
the sampling rate of the audio source to 16000 Hz. If that's not possible,
use the native sample rate of the audio source (instead of resampling).
Note that this field is marked as OPTIONAL for backward compatibility
reasons. It is (and has always been) effectively REQUIRED.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setSampleRateHertz

Optional. Sample rate in Hertz of the audio data sent for recognition.

Valid values are: 8000-48000, and 16000 is optimal. For best results, set
the sampling rate of the audio source to 16000 Hz. If that's not possible,
use the native sample rate of the audio source (instead of resampling).
Note that this field is marked as OPTIONAL for backward compatibility
reasons. It is (and has always been) effectively REQUIRED.

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

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

### getAudioChannelCount

Optional. Number of channels present in the audio data sent for
recognition. Note that this field is marked as OPTIONAL for backward
compatibility reasons. It is (and has always been) effectively REQUIRED.

The maximum allowed value is 8.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setAudioChannelCount

Optional. Number of channels present in the audio data sent for
recognition. Note that this field is marked as OPTIONAL for backward
compatibility reasons. It is (and has always been) effectively REQUIRED.

The maximum allowed value is 8.

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

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