# Cloud Video Intelligence V1 Client - Class SpeechTranscriptionConfig (2.2.0)

2.2.0 (latest) 2.1.2 2.0.5 1.15.5 1.14.2 1.13.1 1.12.16 Reference documentation and code samples for the Cloud Video Intelligence V1 Client class SpeechTranscriptionConfig.

Config for SPEECH_TRANSCRIPTION.

Generated from protobuf message `google.cloud.videointelligence.v1.SpeechTranscriptionConfig`

## Namespace

Google \\ Cloud \\ VideoIntelligence \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ language_code` | `string` Required. *Required* The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported language codes. |
| `↳ max_alternatives` | `int` Optional. Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of `SpeechRecognitionAlternative` messages within each `SpeechTranscription`. The server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one. If omitted, will return a maximum of one. |
| `↳ filter_profanity` | `bool` Optional. If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, e.g. "f\*\*\*". If set to `false` or omitted, profanities won't be filtered out. |
| `↳ speech_contexts` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.SpeechContext>` Optional. A means to provide context to assist the speech recognition. |
| `↳ enable_automatic_punctuation` | `bool` Optional. If 'true', adds punctuation to recognition result hypotheses. This feature is only available in select languages. Setting this for requests in other languages has no effect at all. The default 'false' value does not add punctuation to result hypotheses. NOTE: "This is currently offered as an experimental service, complimentary to all users. In the future this may be exclusively available as a premium feature." |
| `↳ audio_tracks` | `int[]` Optional. For file formats, such as MXF or MKV, supporting multiple audio tracks, specify up to two tracks. Default: track 0. |
| `↳ enable_speaker_diarization` | `bool` Optional. If 'true', enables speaker detection for each recognized word in the top alternative of the recognition result using a speaker_tag provided in the WordInfo. Note: When this is true, we send all the words from the beginning of the audio for the top alternative in every consecutive response. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. |
| `↳ diarization_speaker_count` | `int` Optional. If set, specifies the estimated number of speakers in the conversation. If not set, defaults to '2'. Ignored unless enable_speaker_diarization is set to true. |
| `↳ enable_word_confidence` | `bool` Optional. If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`. |

### getLanguageCode

Required. *Required* The language of the supplied audio as a
[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.

Example: "en-US".
See [Language Support](https://cloud.google.com/speech/docs/languages)
for a list of the currently supported language codes.

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

### setLanguageCode

Required. *Required* The language of the supplied audio as a
[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.

Example: "en-US".
See [Language Support](https://cloud.google.com/speech/docs/languages)
for a list of the currently supported language codes.

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

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

### getMaxAlternatives

Optional. Maximum number of recognition hypotheses to be returned.

Specifically, the maximum number of `SpeechRecognitionAlternative` messages
within each `SpeechTranscription`. The server may return fewer than
`max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will
return a maximum of one. If omitted, will return a maximum of one.

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

### setMaxAlternatives

Optional. Maximum number of recognition hypotheses to be returned.

Specifically, the maximum number of `SpeechRecognitionAlternative` messages
within each `SpeechTranscription`. The server may return fewer than
`max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will
return a maximum of one. If omitted, will return a maximum of one.

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

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

### getFilterProfanity

Optional. If set to `true`, the server will attempt to filter out
profanities, replacing all but the initial character in each filtered word
with asterisks, e.g. "f\*\*\*". If set to `false` or omitted, profanities
won't be filtered out.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setFilterProfanity

Optional. If set to `true`, the server will attempt to filter out
profanities, replacing all but the initial character in each filtered word
with asterisks, e.g. "f\*\*\*". If set to `false` or omitted, profanities
won't be filtered out.

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

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

### getSpeechContexts

Optional. A means to provide context to assist the speech recognition.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.SpeechContext>` |   |

### setSpeechContexts

Optional. A means to provide context to assist the speech recognition.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.SpeechContext>` |

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

### getEnableAutomaticPunctuation

Optional. If 'true', adds punctuation to recognition result hypotheses.

This feature is only available in select languages. Setting this for
requests in other languages has no effect at all. The default 'false' value
does not add punctuation to result hypotheses. NOTE: "This is currently
offered as an experimental service, complimentary to all users. In the
future this may be exclusively available as a premium feature."

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableAutomaticPunctuation

Optional. If 'true', adds punctuation to recognition result hypotheses.

This feature is only available in select languages. Setting this for
requests in other languages has no effect at all. The default 'false' value
does not add punctuation to result hypotheses. NOTE: "This is currently
offered as an experimental service, complimentary to all users. In the
future this may be exclusively available as a premium feature."

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

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

### getAudioTracks

Optional. For file formats, such as MXF or MKV, supporting multiple audio
tracks, specify up to two tracks. Default: track 0.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setAudioTracks

Optional. For file formats, such as MXF or MKV, supporting multiple audio
tracks, specify up to two tracks. Default: track 0.

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

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

### getEnableSpeakerDiarization

Optional. If 'true', enables speaker detection for each recognized word in
the top alternative of the recognition result using a speaker_tag provided
in the WordInfo.

Note: When this is true, we send all the words from the beginning of the
audio for the top alternative in every consecutive response.
This is done in order to improve our speaker tags as our models learn to
identify the speakers in the conversation over time.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableSpeakerDiarization

Optional. If 'true', enables speaker detection for each recognized word in
the top alternative of the recognition result using a speaker_tag provided
in the WordInfo.

Note: When this is true, we send all the words from the beginning of the
audio for the top alternative in every consecutive response.
This is done in order to improve our speaker tags as our models learn to
identify the speakers in the conversation over time.

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

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

### getDiarizationSpeakerCount

Optional. If set, specifies the estimated number of speakers in the
conversation. If not set, defaults to '2'. Ignored unless
enable_speaker_diarization is set to true.

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

### setDiarizationSpeakerCount

Optional. If set, specifies the estimated number of speakers in the
conversation. If not set, defaults to '2'. Ignored unless
enable_speaker_diarization is set to true.

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

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

### getEnableWordConfidence

Optional. If `true`, the top result includes a list of words and the
confidence for those words. If `false`, no word-level confidence
information is returned. The default is `false`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableWordConfidence

Optional. If `true`, the top result includes a list of words and the
confidence for those words. If `false`, no word-level confidence
information is returned. The default is `false`.

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

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