Cloud Speech V2 Client - Class StreamingRecognitionFeatures (1.19.2)

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
Name Description
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 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
Type Description
bool

setEnableVoiceActivityEvents

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

Parameter
Name Description
var bool
Returns
Type Description
$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
Type Description
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
Name Description
var bool
Returns
Type Description
$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
Type Description
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
Name Description
var StreamingRecognitionFeatures\VoiceActivityTimeout
Returns
Type Description
$this