Reference documentation and code samples for the Cloud Speech V2 Client class RecognizeRequest.
Request message for the Recognize method. Multiple RecognizeRequest messages are sent in one call.
If the Recognizer referenced by recognizer contains a fully specified request configuration then the stream may only contain messages with only audio set. Otherwise the first message must contain a recognizer and a _config message that together fully specify the request configuration and must not contain audio. All subsequent messages must only have audio set.
Generated from protobuf message google.cloud.speech.v2.RecognizeRequest
Namespace
Google \ Cloud \ Speech \ V2Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data | array Optional. Data for populating the Message object. |
↳ recognizer | string Required. The name of the Recognizer to use during recognition. The expected format is |
↳ _config | RecognitionConfig RecognitionConfig 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. Maximum size for this field is 15 KB per request. |
getRecognizer
Required. The name of the Recognizer to use during recognition. The expected format is projects/{project}/locations/{location}/recognizers/{recognizer}
. The {recognizer} segment may be set to _
to use an empty implicit Recognizer.
Returns | |
---|---|
Type | Description |
string |
setRecognizer
Required. The name of the Recognizer to use during recognition. The expected format is projects/{project}/locations/{location}/recognizers/{recognizer}
. The {recognizer} segment may be set to _
to use an empty implicit Recognizer.
Parameter | |
---|---|
Name | Description |
var | string |
Returns | |
---|---|
Type | Description |
$this |
getConfig
RecognitionConfig to be used in this recognition attempt.
If provided, it will override the default RecognitionConfig stored in the Recognizer.
Returns | |
---|---|
Type | Description |
RecognitionConfig|null |
hasConfig
setConfig
RecognitionConfig to be used in this recognition attempt.
If provided, it will override the default RecognitionConfig stored in the Recognizer.
Parameter | |
---|---|
Name | Description |
var | RecognitionConfig |
Returns | |
---|---|
Type | Description |
$this |
getAudio
Inline audio bytes to be Recognized.
Maximum size for this field is 15 KB per request.
Returns | |
---|---|
Type | Description |
string |
hasAudio
setAudio
Inline audio bytes to be Recognized.
Maximum size for this field is 15 KB per request.
Parameter | |
---|---|
Name | Description |
var | string |
Returns | |
---|---|
Type | Description |
$this |
getRequest
Returns | |
---|---|
Type | Description |
string |