Reference documentation and code samples for the Cloud Speech V1p1beta1 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.v1p1beta1.StreamingRecognitionResult
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ alternatives |
array<Google\Cloud\Speech\V1p1beta1\SpeechRecognitionAlternative>
May contain one or more recognition hypotheses (up to the maximum specified in |
↳ is_final |
bool
If |
↳ 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 ( |
↳ result_end_time |
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 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 (up to the
maximum specified in max_alternatives
).
These alternatives are ordered in terms of accuracy, with the top (first) alternative being the most probable, as ranked by the recognizer.
Generated from protobuf field repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setAlternatives
May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives
).
These alternatives are ordered in terms of accuracy, with the top (first) alternative being the most probable, as ranked by the recognizer.
Generated from protobuf field repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1;
Parameter | |
---|---|
Name | Description |
var |
array<Google\Cloud\Speech\V1p1beta1\SpeechRecognitionAlternative>
|
Returns | |
---|---|
Type | Description |
$this |
getIsFinal
If false
, this StreamingRecognitionResult
represents an
interim result that may change. If true
, this is the final time the
speech service will return this particular StreamingRecognitionResult
,
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.
Generated from protobuf field bool is_final = 2;
Returns | |
---|---|
Type | Description |
bool |
setIsFinal
If false
, this StreamingRecognitionResult
represents an
interim result that may change. If true
, this is the final time the
speech service will return this particular StreamingRecognitionResult
,
the recognizer will not return any further hypotheses for this portion of
the transcript and corresponding audio.
Generated from protobuf field bool is_final = 2;
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 indicating stability
was not set.
Generated from protobuf field float stability = 3;
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 indicating stability
was not set.
Generated from protobuf field float stability = 3;
Parameter | |
---|---|
Name | Description |
var |
float
|
Returns | |
---|---|
Type | Description |
$this |
getResultEndTime
Time offset of the end of this result relative to the beginning of the audio.
Generated from protobuf field .google.protobuf.Duration result_end_time = 4;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Duration|null |
hasResultEndTime
clearResultEndTime
setResultEndTime
Time offset of the end of this result relative to the beginning of the audio.
Generated from protobuf field .google.protobuf.Duration result_end_time = 4;
Parameter | |
---|---|
Name | Description |
var |
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'.
Generated from protobuf field int32 channel_tag = 5;
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'.
Generated from protobuf field int32 channel_tag = 5;
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getLanguageCode
Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns | |
---|---|
Type | Description |
string |
setLanguageCode
Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |