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

A streaming speech recognition result corresponding to a portion of the audio
that is currently being processed.

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

## Namespace

Google \\ Cloud \\ Speech \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ alternatives` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.SpeechRecognitionAlternative>` May contain one or more recognition hypotheses. These alternatives are ordered in terms of accuracy, with the top (first) alternative being the most probable, as ranked by the recognizer. |
| `↳ is_final` | `bool` If `false`, this [StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult) represents an interim result that may change. If `true`, this is the final time the speech service will return this particular [StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult), the recognizer will not return any further hypotheses for this portion of the transcript and corresponding audio. |
| `↳ stability` | `float` An estimate of the likelihood that the recognizer will not change its guess about this interim result. Values range from 0.0 (completely unstable) to 1.0 (completely stable). This field is only provided for interim results ([is_final](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__)=`false`). The default of 0.0 is a sentinel value indicating `stability` was not set. |
| `↳ result_end_offset` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Time offset of the end of this result relative to the beginning of the audio. |
| `↳ channel_tag` | `int` For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For `audio_channel_count` = `N`, its output values can range from `1` to `N`. |
| `↳ language_code` | `string` Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio. |

### getAlternatives

May contain one or more recognition hypotheses. These alternatives are
ordered in terms of accuracy, with the top (first) alternative being the
most probable, as ranked by the recognizer.

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

### setAlternatives

May contain one or more recognition hypotheses. These alternatives are
ordered in terms of accuracy, with the top (first) alternative being the
most probable, as ranked by the recognizer.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.SpeechRecognitionAlternative>` |

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

### getIsFinal

If `false`, this
[StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult)
represents an interim result that may change. If `true`, this is the final
time the speech service will return this particular
[StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult),
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.

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

### setIsFinal

If `false`, this
[StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult)
represents an interim result that may change. If `true`, this is the final
time the speech service will return this particular
[StreamingRecognitionResult](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult),
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.

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

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

### getStability

An estimate of the likelihood that the recognizer will not change its guess
about this interim result. Values range from 0.0 (completely unstable)
to 1.0 (completely stable). This field is only provided for interim results
([is_final](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__)=`false`).

The default of 0.0 is a sentinel value indicating `stability` was not set.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setStability

An estimate of the likelihood that the recognizer will not change its guess
about this interim result. Values range from 0.0 (completely unstable)
to 1.0 (completely stable). This field is only provided for interim results
([is_final](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__)=`false`).

The default of 0.0 is a sentinel value indicating `stability` was not set.

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

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

### getResultEndOffset

Time offset of the end of this result relative to the beginning of the
audio.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasResultEndOffset

### clearResultEndOffset

### setResultEndOffset

Time offset of the end of this result relative to the beginning of the
audio.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getChannelTag

For multi-channel audio, this is the channel number corresponding to the
recognized result for the audio from that channel.

For
`audio_channel_count` = `N`, its output values can range from `1` to `N`.

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

### setChannelTag

For multi-channel audio, this is the channel number corresponding to the
recognized result for the audio from that channel.

For
`audio_channel_count` = `N`, its output values can range from `1` to `N`.

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

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

### getLanguageCode

Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
language tag of the language in this result. This language code was
detected to have the most likelihood of being spoken in the audio.

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

### setLanguageCode

Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
language tag of the language in this result. This language code was
detected to have the most likelihood of being spoken in the audio.

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

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