# Google Cloud Dialogflow V2 Client - Class OutputAudioConfig (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class OutputAudioConfig.

Instructs the speech synthesizer on how to generate the output audio content.

If this audio config is supplied in a request, it overrides all existing
text-to-speech settings applied to the agent.

Generated from protobuf message `google.cloud.dialogflow.v2.OutputAudioConfig`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ audio_encoding` | `int` Required. Audio encoding of the synthesized audio content. |
| `↳ sample_rate_hertz` | `int` The synthesis sample rate (in hertz) for this audio. If not provided, then the synthesizer will use the default sample rate based on the audio encoding. If this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality). |
| `↳ synthesize_speech_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.SynthesizeSpeechConfig` Configuration of how speech should be synthesized. |

### getAudioEncoding

Required. Audio encoding of the synthesized audio content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [OutputAudioEncoding](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.OutputAudioEncoding). |

### setAudioEncoding

Required. Audio encoding of the synthesized audio content.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [OutputAudioEncoding](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.OutputAudioEncoding). |

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

### getSampleRateHertz

The synthesis sample rate (in hertz) for this audio. If not
provided, then the synthesizer will use the default sample rate based on
the audio encoding. If this is different from the voice's natural sample
rate, then the synthesizer will honor this request by converting to the
desired sample rate (which might result in worse audio quality).

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

### setSampleRateHertz

The synthesis sample rate (in hertz) for this audio. If not
provided, then the synthesizer will use the default sample rate based on
the audio encoding. If this is different from the voice's natural sample
rate, then the synthesizer will honor this request by converting to the
desired sample rate (which might result in worse audio quality).

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

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

### getSynthesizeSpeechConfig

Configuration of how speech should be synthesized.

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

### hasSynthesizeSpeechConfig

### clearSynthesizeSpeechConfig

### setSynthesizeSpeechConfig

Configuration of how speech should be synthesized.

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

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