# Cloud Text-to-Speech V1 Client - Class SynthesizeSpeechRequest (2.8.0)

2.8.0 (latest) 2.7.0 2.6.0 2.5.1 2.4.0 2.3.0 2.2.2 2.0.1 1.12.2 1.11.0 1.10.0 1.9.1 1.8.5 1.7.2 1.6.1 1.5.6 1.4.5 Reference documentation and code samples for the Cloud Text-to-Speech V1 Client class SynthesizeSpeechRequest.

The top-level message sent by the client for the `SynthesizeSpeech` method.

Generated from protobuf message `google.cloud.texttospeech.v1.SynthesizeSpeechRequest`

## Namespace

Google \\ Cloud \\ TextToSpeech \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ input` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.SynthesisInput` Required. The Synthesizer requires either plain text or SSML as input. |
| `↳ voice` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.VoiceSelectionParams` Required. The desired voice of the synthesized audio. |
| `↳ audio_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AudioConfig` Required. The configuration of the synthesized audio. |
| `↳ advanced_voice_options` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AdvancedVoiceOptions` Optional. Advanced voice options. |

### getInput

Required. The Synthesizer requires either plain text or SSML as input.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.SynthesisInput|null` |   |

### hasInput

### clearInput

### setInput

Required. The Synthesizer requires either plain text or SSML as input.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.SynthesisInput` |

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

### getVoice

Required. The desired voice of the synthesized audio.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.VoiceSelectionParams|null` |   |

### hasVoice

### clearVoice

### setVoice

Required. The desired voice of the synthesized audio.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.VoiceSelectionParams` |

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

### getAudioConfig

Required. The configuration of the synthesized audio.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AudioConfig|null` |   |

### hasAudioConfig

### clearAudioConfig

### setAudioConfig

Required. The configuration of the synthesized audio.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AudioConfig` |

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

### getAdvancedVoiceOptions

Optional. Advanced voice options.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AdvancedVoiceOptions|null` |   |

### hasAdvancedVoiceOptions

### clearAdvancedVoiceOptions

### setAdvancedVoiceOptions

Optional. Advanced voice options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AdvancedVoiceOptions` |

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.SynthesisInput` Required. The Synthesizer requires either plain text or SSML as input. |
| `voice` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.VoiceSelectionParams` Required. The desired voice of the synthesized audio. |
| `audioConfig` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.AudioConfig` Required. The configuration of the synthesized audio. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.SynthesizeSpeechRequest` |   |