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
Iffalse, thisStreamingRecognitionResultrepresents an interim result that may change. Iftrue, this is the final time the speech service will return this particularStreamingRecognitionResult, 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=false). The default of 0.0 is a sentinel value indicatingstabilitywas not set.
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. Foraudio_channel_count=N, its output values can range from1toN.
↳ language_code
string
Output only. TheBCP-47language 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.
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.
Iffalse, thisStreamingRecognitionResultrepresents an interim result that may change. Iftrue, this is the final
time the speech service will return this particularStreamingRecognitionResult,
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.
Returns
Type
Description
bool
setIsFinal
Iffalse, thisStreamingRecognitionResultrepresents an interim result that may change. Iftrue, this is the final
time the speech service will return this particularStreamingRecognitionResult,
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=false).
The default of 0.0 is a sentinel value indicatingstabilitywas 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=false).
The default of 0.0 is a sentinel value indicatingstabilitywas 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.
For multi-channel audio, this is the channel number corresponding to the
recognized result for the audio from that channel.
Foraudio_channel_count=N, its output values can range from1toN.
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.
Foraudio_channel_count=N, its output values can range from1toN.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getLanguageCode
Output only. TheBCP-47language 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. TheBCP-47language tag of the language in this result. This language code was
detected to have the most likelihood of being spoken in the audio.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Speech V2 Client - Class StreamingRecognitionResult (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult)\n- [2.1.0](/php/docs/reference/cloud-speech/2.1.0/V2.StreamingRecognitionResult)\n- [2.0.1](/php/docs/reference/cloud-speech/2.0.1/V2.StreamingRecognitionResult)\n- [1.20.1](/php/docs/reference/cloud-speech/1.20.1/V2.StreamingRecognitionResult)\n- [1.19.2](/php/docs/reference/cloud-speech/1.19.2/V2.StreamingRecognitionResult)\n- [1.18.3](/php/docs/reference/cloud-speech/1.18.3/V2.StreamingRecognitionResult)\n- [1.16.0](/php/docs/reference/cloud-speech/1.16.0/V2.StreamingRecognitionResult)\n- [1.15.0](/php/docs/reference/cloud-speech/1.15.0/V2.StreamingRecognitionResult)\n- [1.14.3](/php/docs/reference/cloud-speech/1.14.3/V2.StreamingRecognitionResult)\n- [1.13.1](/php/docs/reference/cloud-speech/1.13.1/V2.StreamingRecognitionResult)\n- [1.12.0](/php/docs/reference/cloud-speech/1.12.0/V2.StreamingRecognitionResult)\n- [1.11.2](/php/docs/reference/cloud-speech/1.11.2/V2.StreamingRecognitionResult)\n- [1.10.0](/php/docs/reference/cloud-speech/1.10.0/V2.StreamingRecognitionResult)\n- [1.9.1](/php/docs/reference/cloud-speech/1.9.1/V2.StreamingRecognitionResult)\n- [1.8.0](/php/docs/reference/cloud-speech/1.8.0/V2.StreamingRecognitionResult)\n- [1.7.0](/php/docs/reference/cloud-speech/1.7.0/V2.StreamingRecognitionResult) \nReference documentation and code samples for the Cloud Speech V2 Client class StreamingRecognitionResult.\n\nA streaming speech recognition result corresponding to a portion of the audio\nthat is currently being processed.\n\nGenerated from protobuf message `google.cloud.speech.v2.StreamingRecognitionResult`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Speech \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getAlternatives\n\nMay contain one or more recognition hypotheses. These alternatives are\nordered in terms of accuracy, with the top (first) alternative being the\nmost probable, as ranked by the recognizer.\n\n### setAlternatives\n\nMay contain one or more recognition hypotheses. These alternatives are\nordered in terms of accuracy, with the top (first) alternative being the\nmost probable, as ranked by the recognizer.\n\n### getIsFinal\n\nIf `false`, this\n[StreamingRecognitionResult](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult)\nrepresents an interim result that may change. If `true`, this is the final\ntime the speech service will return this particular\n[StreamingRecognitionResult](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult),\nthe recognizer will not return any further hypotheses for this portion of\nthe transcript and corresponding audio.\n\n### setIsFinal\n\nIf `false`, this\n[StreamingRecognitionResult](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult)\nrepresents an interim result that may change. If `true`, this is the final\ntime the speech service will return this particular\n[StreamingRecognitionResult](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult),\nthe recognizer will not return any further hypotheses for this portion of\nthe transcript and corresponding audio.\n\n### getStability\n\nAn estimate of the likelihood that the recognizer will not change its guess\nabout this interim result. Values range from 0.0 (completely unstable)\nto 1.0 (completely stable). This field is only provided for interim results\n([is_final](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__)=`false`).\n\nThe default of 0.0 is a sentinel value indicating `stability` was not set.\n\n### setStability\n\nAn estimate of the likelihood that the recognizer will not change its guess\nabout this interim result. Values range from 0.0 (completely unstable)\nto 1.0 (completely stable). This field is only provided for interim results\n([is_final](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__)=`false`).\n\nThe default of 0.0 is a sentinel value indicating `stability` was not set.\n\n### getResultEndOffset\n\nTime offset of the end of this result relative to the beginning of the\naudio.\n\n### hasResultEndOffset\n\n### clearResultEndOffset\n\n### setResultEndOffset\n\nTime offset of the end of this result relative to the beginning of the\naudio.\n\n### getChannelTag\n\nFor multi-channel audio, this is the channel number corresponding to the\nrecognized result for the audio from that channel.\n\nFor\n`audio_channel_count` = `N`, its output values can range from `1` to `N`.\n\n### setChannelTag\n\nFor multi-channel audio, this is the channel number corresponding to the\nrecognized result for the audio from that channel.\n\nFor\n`audio_channel_count` = `N`, its output values can range from `1` to `N`.\n\n### getLanguageCode\n\nOutput only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)\nlanguage tag of the language in this result. This language code was\ndetected to have the most likelihood of being spoken in the audio.\n\n### setLanguageCode\n\nOutput only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)\nlanguage tag of the language in this result. This language code was\ndetected to have the most likelihood of being spoken in the audio."]]