Time offset relative to the beginning of the audio, and corresponding to the start of the spoken word. This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
Time offset relative to the beginning of the audio, and corresponding to the end of the spoken word. This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
↳ word
string
The word corresponding to this set of information.
↳ confidence
float
The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is set only for the top alternative of a non-streaming result or, of a streaming result whereis_finalis set totrue. This field is not guaranteed to be accurate and users should not rely on it to be always provided. The default of 0.0 is a sentinel value indicatingconfidencewas not set.
↳ speaker_label
string
A distinct label is assigned for every speaker within the audio. This field specifies which one of those speakers was detected to have spoken this word.speaker_labelis set ifSpeakerDiarizationConfigis given and only in the top alternative.
getStartOffset
Time offset relative to the beginning of the audio,
and corresponding to the start of the spoken word.
This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature
and the accuracy of the time offset can vary.
Time offset relative to the beginning of the audio,
and corresponding to the start of the spoken word.
This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature
and the accuracy of the time offset can vary.
Time offset relative to the beginning of the audio,
and corresponding to the end of the spoken word.
This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature
and the accuracy of the time offset can vary.
Time offset relative to the beginning of the audio,
and corresponding to the end of the spoken word.
This field is only set ifenable_word_time_offsetsistrueand only in the top hypothesis. This is an experimental feature
and the accuracy of the time offset can vary.
The word corresponding to this set of information.
Returns
Type
Description
string
setWord
The word corresponding to this set of information.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getConfidence
The confidence estimate between 0.0 and 1.0. A higher number
indicates an estimated greater likelihood that the recognized words are
correct. This field is set only for the top alternative of a non-streaming
result or, of a streaming result whereis_finalis
set totrue. This field is not guaranteed to be accurate and users should
not rely on it to be always provided. The default of 0.0 is a sentinel
value indicatingconfidencewas not set.
Returns
Type
Description
float
setConfidence
The confidence estimate between 0.0 and 1.0. A higher number
indicates an estimated greater likelihood that the recognized words are
correct. This field is set only for the top alternative of a non-streaming
result or, of a streaming result whereis_finalis
set totrue. This field is not guaranteed to be accurate and users should
not rely on it to be always provided. The default of 0.0 is a sentinel
value indicatingconfidencewas not set.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getSpeakerLabel
A distinct label is assigned for every speaker within the audio. This field
specifies which one of those speakers was detected to have spoken this
word.speaker_labelis set ifSpeakerDiarizationConfigis given and only in the top alternative.
Returns
Type
Description
string
setSpeakerLabel
A distinct label is assigned for every speaker within the audio. This field
specifies which one of those speakers was detected to have spoken this
word.speaker_labelis set ifSpeakerDiarizationConfigis given and only in the top alternative.
[[["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 WordInfo (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-speech/latest/V2.WordInfo)\n- [2.1.0](/php/docs/reference/cloud-speech/2.1.0/V2.WordInfo)\n- [2.0.1](/php/docs/reference/cloud-speech/2.0.1/V2.WordInfo)\n- [1.20.1](/php/docs/reference/cloud-speech/1.20.1/V2.WordInfo)\n- [1.19.2](/php/docs/reference/cloud-speech/1.19.2/V2.WordInfo)\n- [1.18.3](/php/docs/reference/cloud-speech/1.18.3/V2.WordInfo)\n- [1.16.0](/php/docs/reference/cloud-speech/1.16.0/V2.WordInfo)\n- [1.15.0](/php/docs/reference/cloud-speech/1.15.0/V2.WordInfo)\n- [1.14.3](/php/docs/reference/cloud-speech/1.14.3/V2.WordInfo)\n- [1.13.1](/php/docs/reference/cloud-speech/1.13.1/V2.WordInfo)\n- [1.12.0](/php/docs/reference/cloud-speech/1.12.0/V2.WordInfo)\n- [1.11.2](/php/docs/reference/cloud-speech/1.11.2/V2.WordInfo)\n- [1.10.0](/php/docs/reference/cloud-speech/1.10.0/V2.WordInfo)\n- [1.9.1](/php/docs/reference/cloud-speech/1.9.1/V2.WordInfo)\n- [1.8.0](/php/docs/reference/cloud-speech/1.8.0/V2.WordInfo)\n- [1.7.0](/php/docs/reference/cloud-speech/1.7.0/V2.WordInfo) \nReference documentation and code samples for the Cloud Speech V2 Client class WordInfo.\n\nWord-specific information for recognized words.\n\nGenerated from protobuf message `google.cloud.speech.v2.WordInfo`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Speech \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getStartOffset\n\nTime offset relative to the beginning of the audio,\nand corresponding to the start of the spoken word.\n\nThis field is only set if\n[enable_word_time_offsets](/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures#_Google_Cloud_Speech_V2_RecognitionFeatures__getEnableWordTimeOffsets__)\nis `true` and only in the top hypothesis. This is an experimental feature\nand the accuracy of the time offset can vary.\n\n### hasStartOffset\n\n### clearStartOffset\n\n### setStartOffset\n\nTime offset relative to the beginning of the audio,\nand corresponding to the start of the spoken word.\n\nThis field is only set if\n[enable_word_time_offsets](/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures#_Google_Cloud_Speech_V2_RecognitionFeatures__getEnableWordTimeOffsets__)\nis `true` and only in the top hypothesis. This is an experimental feature\nand the accuracy of the time offset can vary.\n\n### getEndOffset\n\nTime offset relative to the beginning of the audio,\nand corresponding to the end of the spoken word.\n\nThis field is only set if\n[enable_word_time_offsets](/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures#_Google_Cloud_Speech_V2_RecognitionFeatures__getEnableWordTimeOffsets__)\nis `true` and only in the top hypothesis. This is an experimental feature\nand the accuracy of the time offset can vary.\n\n### hasEndOffset\n\n### clearEndOffset\n\n### setEndOffset\n\nTime offset relative to the beginning of the audio,\nand corresponding to the end of the spoken word.\n\nThis field is only set if\n[enable_word_time_offsets](/php/docs/reference/cloud-speech/latest/V2.RecognitionFeatures#_Google_Cloud_Speech_V2_RecognitionFeatures__getEnableWordTimeOffsets__)\nis `true` and only in the top hypothesis. This is an experimental feature\nand the accuracy of the time offset can vary.\n\n### getWord\n\nThe word corresponding to this set of information.\n\n### setWord\n\nThe word corresponding to this set of information.\n\n### getConfidence\n\nThe confidence estimate between 0.0 and 1.0. A higher number\nindicates an estimated greater likelihood that the recognized words are\ncorrect. This field is set only for the top alternative of a non-streaming\nresult or, of a streaming result where\n[is_final](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__) is\nset to `true`. This field is not guaranteed to be accurate and users should\nnot rely on it to be always provided. The default of 0.0 is a sentinel\nvalue indicating `confidence` was not set.\n\n### setConfidence\n\nThe confidence estimate between 0.0 and 1.0. A higher number\nindicates an estimated greater likelihood that the recognized words are\ncorrect. This field is set only for the top alternative of a non-streaming\nresult or, of a streaming result where\n[is_final](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionResult#_Google_Cloud_Speech_V2_StreamingRecognitionResult__getIsFinal__) is\nset to `true`. This field is not guaranteed to be accurate and users should\nnot rely on it to be always provided. The default of 0.0 is a sentinel\nvalue indicating `confidence` was not set.\n\n### getSpeakerLabel\n\nA distinct label is assigned for every speaker within the audio. This field\nspecifies which one of those speakers was detected to have spoken this\nword. `speaker_label` is set if\n[SpeakerDiarizationConfig](/php/docs/reference/cloud-speech/latest/V2.SpeakerDiarizationConfig)\nis given and only in the top alternative.\n\n### setSpeakerLabel\n\nA distinct label is assigned for every speaker within the audio. This field\nspecifies which one of those speakers was detected to have spoken this\nword. `speaker_label` is set if\n[SpeakerDiarizationConfig](/php/docs/reference/cloud-speech/latest/V2.SpeakerDiarizationConfig)\nis given and only in the top alternative."]]