Cloud Speech V2 Client - Class StreamingRecognizeRequest (1.8.0)

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

Request message for the StreamingRecognize method. Multiple StreamingRecognizeRequest messages are sent. The first message must contain a recognizer and optionally a streaming_config message and must not contain audio. All subsequent messages must contain audio and must not contain a streaming_config message.

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ recognizer string

Required. Streaming recognition should start with an initial request having a recognizer. Subsequent requests carry the audio data to be recognized. The initial request with configuration can be omitted if the Recognizer being used has a default_recognition_config.

↳ streaming_config Google\Cloud\Speech\V2\StreamingRecognitionConfig

StreamingRecognitionConfig to be used in this recognition attempt. If provided, it will override the default RecognitionConfig stored in the Recognizer.

↳ audio string

Inline audio bytes to be Recognized.

getRecognizer

Required. Streaming recognition should start with an initial request having a recognizer. Subsequent requests carry the audio data to be recognized.

The initial request with configuration can be omitted if the Recognizer being used has a default_recognition_config.

Generated from protobuf field string recognizer = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {

Returns
TypeDescription
string

setRecognizer

Required. Streaming recognition should start with an initial request having a recognizer. Subsequent requests carry the audio data to be recognized.

The initial request with configuration can be omitted if the Recognizer being used has a default_recognition_config.

Generated from protobuf field string recognizer = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getStreamingConfig

StreamingRecognitionConfig to be used in this recognition attempt.

If provided, it will override the default RecognitionConfig stored in the Recognizer.

Generated from protobuf field .google.cloud.speech.v2.StreamingRecognitionConfig streaming_config = 6;

Returns
TypeDescription
Google\Cloud\Speech\V2\StreamingRecognitionConfig|null

hasStreamingConfig

setStreamingConfig

StreamingRecognitionConfig to be used in this recognition attempt.

If provided, it will override the default RecognitionConfig stored in the Recognizer.

Generated from protobuf field .google.cloud.speech.v2.StreamingRecognitionConfig streaming_config = 6;

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

getAudio

Inline audio bytes to be Recognized.

Generated from protobuf field bytes audio = 5;

Returns
TypeDescription
string

hasAudio

setAudio

Inline audio bytes to be Recognized.

Generated from protobuf field bytes audio = 5;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getStreamingRequest

Returns
TypeDescription
string