Cloud Speech V2 Client - Class StreamingRecognitionFeatures (1.15.0)

Reference documentation and code samples for the Cloud Speech V2 Client class StreamingRecognitionFeatures.

Available recognition features specific to streaming recognition requests.

Generated from protobuf message google.cloud.speech.v2.StreamingRecognitionFeatures

Namespace

Google \ Cloud \ Speech \ V2

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ enable_voice_activity_events bool

If true, responses with voice activity speech events will be returned as they are detected.

↳ interim_results bool

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

↳ voice_activity_timeout Google\Cloud\Speech\V2\StreamingRecognitionFeatures\VoiceActivityTimeout

If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field voice_activity_events must also be set to true.

getEnableVoiceActivityEvents

If true, responses with voice activity speech events will be returned as they are detected.

Returns
TypeDescription
bool

setEnableVoiceActivityEvents

If true, responses with voice activity speech events will be returned as they are detected.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getInterimResults

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

Returns
TypeDescription
bool

setInterimResults

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getVoiceActivityTimeout

If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field voice_activity_events must also be set to true.

Returns
TypeDescription
Google\Cloud\Speech\V2\StreamingRecognitionFeatures\VoiceActivityTimeout|null

hasVoiceActivityTimeout

clearVoiceActivityTimeout

setVoiceActivityTimeout

If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field voice_activity_events must also be set to true.

Parameter
NameDescription
var Google\Cloud\Speech\V2\StreamingRecognitionFeatures\VoiceActivityTimeout
Returns
TypeDescription
$this