If theRecognizerreferenced byrecognizercontains a fully specified request configuration then the stream may only
contain messages with onlyaudioset.
Otherwise the first message must contain arecognizerand
astreaming_configmessage that together fully specify the request configuration and must not
containaudio. All
subsequent messages must only haveaudioset.
Generated from protobuf messagegoogle.cloud.speech.v2.StreamingRecognizeRequest
Namespace
Google \ Cloud \ Speech \ V2
Methods
__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 isprojects/{project}/locations/{location}/recognizers/{recognizer}. The {recognizer} segment may be set to_to use an empty implicit Recognizer.
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. Maximum size for this field is 15 KB per request.
getRecognizer
Required. The name of the Recognizer to use during recognition. The
expected format isprojects/{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 isprojects/{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
getStreamingConfig
StreamingRecognitionConfig to be used in this recognition attempt.
If provided, it will override the default RecognitionConfig stored in the
Recognizer.
[[["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 StreamingRecognizeRequest (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest)\n- [2.1.0](/php/docs/reference/cloud-speech/2.1.0/V2.StreamingRecognizeRequest)\n- [2.0.1](/php/docs/reference/cloud-speech/2.0.1/V2.StreamingRecognizeRequest)\n- [1.20.1](/php/docs/reference/cloud-speech/1.20.1/V2.StreamingRecognizeRequest)\n- [1.19.2](/php/docs/reference/cloud-speech/1.19.2/V2.StreamingRecognizeRequest)\n- [1.18.3](/php/docs/reference/cloud-speech/1.18.3/V2.StreamingRecognizeRequest)\n- [1.16.0](/php/docs/reference/cloud-speech/1.16.0/V2.StreamingRecognizeRequest)\n- [1.15.0](/php/docs/reference/cloud-speech/1.15.0/V2.StreamingRecognizeRequest)\n- [1.14.3](/php/docs/reference/cloud-speech/1.14.3/V2.StreamingRecognizeRequest)\n- [1.13.1](/php/docs/reference/cloud-speech/1.13.1/V2.StreamingRecognizeRequest)\n- [1.12.0](/php/docs/reference/cloud-speech/1.12.0/V2.StreamingRecognizeRequest)\n- [1.11.2](/php/docs/reference/cloud-speech/1.11.2/V2.StreamingRecognizeRequest)\n- [1.10.0](/php/docs/reference/cloud-speech/1.10.0/V2.StreamingRecognizeRequest)\n- [1.9.1](/php/docs/reference/cloud-speech/1.9.1/V2.StreamingRecognizeRequest)\n- [1.8.0](/php/docs/reference/cloud-speech/1.8.0/V2.StreamingRecognizeRequest)\n- [1.7.0](/php/docs/reference/cloud-speech/1.7.0/V2.StreamingRecognizeRequest) \nReference documentation and code samples for the Cloud Speech V2 Client class StreamingRecognizeRequest.\n\nRequest message for the\n[StreamingRecognize](/php/docs/reference/cloud-speech/latest/V2.Client.SpeechClient#_Google_Cloud_Speech_V2_Client_SpeechClient__streamingRecognize__)\nmethod. Multiple\n[StreamingRecognizeRequest](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest)\nmessages are sent in one call.\n\nIf the [Recognizer](/php/docs/reference/cloud-speech/latest/V2.Recognizer) referenced by\n[recognizer](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getRecognizer__)\ncontains a fully specified request configuration then the stream may only\ncontain messages with only\n[audio](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__) set.\nOtherwise the first message must contain a\n[recognizer](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getRecognizer__) and\na\n[streaming_config](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getStreamingConfig__)\nmessage that together fully specify the request configuration and must not\ncontain [audio](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__). All\nsubsequent messages must only have\n[audio](/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__) set.\n\nGenerated from protobuf message `google.cloud.speech.v2.StreamingRecognizeRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Speech \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getRecognizer\n\nRequired. The name of the Recognizer to use during recognition. The\nexpected format is\n`projects/{project}/locations/{location}/recognizers/{recognizer}`. The\n{recognizer} segment may be set to `_` to use an empty implicit Recognizer.\n\n### setRecognizer\n\nRequired. The name of the Recognizer to use during recognition. The\nexpected format is\n`projects/{project}/locations/{location}/recognizers/{recognizer}`. The\n{recognizer} segment may be set to `_` to use an empty implicit Recognizer.\n\n### getStreamingConfig\n\nStreamingRecognitionConfig to be used in this recognition attempt.\n\nIf provided, it will override the default RecognitionConfig stored in the\nRecognizer.\n\n### hasStreamingConfig\n\n### setStreamingConfig\n\nStreamingRecognitionConfig to be used in this recognition attempt.\n\nIf provided, it will override the default RecognitionConfig stored in the\nRecognizer.\n\n### getAudio\n\nInline audio bytes to be Recognized.\n\nMaximum size for this field is 15 KB per request.\n\n### hasAudio\n\n### setAudio\n\nInline audio bytes to be Recognized.\n\nMaximum size for this field is 15 KB per request.\n\n### getStreamingRequest"]]