# Cloud Text-to-Speech V1 Client - Class SynthesisInput (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 SynthesisInput.

Contains text input to be synthesized. Either `text` or `ssml` must be
supplied. Supplying both or neither returns
[google.rpc.Code.INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT). The
input size is limited to 5000 bytes.

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

## Namespace

Google \\ Cloud \\ TextToSpeech \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `string` The raw text to be synthesized. |
| `↳ markup` | `string` Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices. |
| `↳ ssml` | `string` The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return [google.rpc.Code.INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT). For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml). |
| `↳ multi_speaker_markup` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.MultiSpeakerMarkup` The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis. |
| `↳ prompt` | `string` This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions. |
| `↳ custom_pronunciations` | `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.CustomPronunciations` Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag. |

### getText

The raw text to be synthesized.

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

### hasText

### setText

The raw text to be synthesized.

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

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

### getMarkup

Markup for Chirp 3: HD voices specifically. This field may not be used
with any other voices.

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

### hasMarkup

### setMarkup

Markup for Chirp 3: HD voices specifically. This field may not be used
with any other voices.

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

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

### getSsml

The SSML document to be synthesized. The SSML document must be valid
and well-formed. Otherwise the RPC will fail and return
[google.rpc.Code.INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT). For
more information, see
[SSML](https://cloud.google.com/text-to-speech/docs/ssml).

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

### hasSsml

### setSsml

The SSML document to be synthesized. The SSML document must be valid
and well-formed. Otherwise the RPC will fail and return
[google.rpc.Code.INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT). For
more information, see
[SSML](https://cloud.google.com/text-to-speech/docs/ssml).

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

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

### getMultiSpeakerMarkup

The multi-speaker input to be synthesized. Only applicable for
multi-speaker synthesis.

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

### hasMultiSpeakerMarkup

### setMultiSpeakerMarkup

The multi-speaker input to be synthesized. Only applicable for
multi-speaker synthesis.

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

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

### getPrompt

This system instruction is supported only for controllable/promptable voice
models. If this system instruction is used, we pass the unedited text to
Gemini-TTS. Otherwise, a default system instruction is used. AI Studio
calls this system instruction, Style Instructions.

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

### hasPrompt

### clearPrompt

### setPrompt

This system instruction is supported only for controllable/promptable voice
models. If this system instruction is used, we pass the unedited text to
Gemini-TTS. Otherwise, a default system instruction is used. AI Studio
calls this system instruction, Style Instructions.

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

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

### getCustomPronunciations

Optional. The pronunciation customizations are applied to the input. If
this is set, the input is synthesized using the given pronunciation
customizations.

The initial support is for en-us, with plans to expand to other locales in
the future. Instant Clone voices aren't supported.
In order to customize the pronunciation of a phrase, there must be an exact
match of the phrase in the input types. If using SSML, the phrase must not
be inside a phoneme tag.

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

### hasCustomPronunciations

### clearCustomPronunciations

### setCustomPronunciations

Optional. The pronunciation customizations are applied to the input. If
this is set, the input is synthesized using the given pronunciation
customizations.

The initial support is for en-us, with plans to expand to other locales in
the future. Instant Clone voices aren't supported.
In order to customize the pronunciation of a phrase, there must be an exact
match of the phrase in the input types. If using SSML, the phrase must not
be inside a phoneme tag.

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

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

### getInputSource

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