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
streaming_config
message that together fully specify the request configuration and must not
contain audio. All
subsequent messages must only have
audio set.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#audio
defaudio()->::String
Returns
(::String) — Inline audio bytes to be Recognized.
Maximum size for this field is 15 KB per request.
Note: The following fields are mutually exclusive: audio, streaming_config. If a field in that set is populated, all other fields in the set will automatically be cleared.
#audio=
defaudio=(value)->::String
Parameter
value (::String) — Inline audio bytes to be Recognized.
Maximum size for this field is 15 KB per request.
Note: The following fields are mutually exclusive: audio, streaming_config. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — Inline audio bytes to be Recognized.
Maximum size for this field is 15 KB per request.
Note: The following fields are mutually exclusive: audio, streaming_config. If a field in that set is populated, all other fields in the set will automatically be cleared.
#recognizer
defrecognizer()->::String
Returns
(::String) — 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.
#recognizer=
defrecognizer=(value)->::String
Parameter
value (::String) — 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
(::String) — 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.
Note: The following fields are mutually exclusive: streaming_config, audio. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: streaming_config, audio. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: streaming_config, audio. If a field in that set is populated, all other fields in the set will automatically be cleared.
[[["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-to-Text V2 API - Class Google::Cloud::Speech::V2::StreamingRecognizeRequest (v1.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.1 (latest)](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [1.2.0](/ruby/docs/reference/google-cloud-speech-v2/1.2.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [1.1.0](/ruby/docs/reference/google-cloud-speech-v2/1.1.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [1.0.1](/ruby/docs/reference/google-cloud-speech-v2/1.0.1/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.16.0](/ruby/docs/reference/google-cloud-speech-v2/0.16.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.15.0](/ruby/docs/reference/google-cloud-speech-v2/0.15.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.14.0](/ruby/docs/reference/google-cloud-speech-v2/0.14.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.13.1](/ruby/docs/reference/google-cloud-speech-v2/0.13.1/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.12.0](/ruby/docs/reference/google-cloud-speech-v2/0.12.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.11.0](/ruby/docs/reference/google-cloud-speech-v2/0.11.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.10.0](/ruby/docs/reference/google-cloud-speech-v2/0.10.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.9.2](/ruby/docs/reference/google-cloud-speech-v2/0.9.2/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.8.0](/ruby/docs/reference/google-cloud-speech-v2/0.8.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.7.0](/ruby/docs/reference/google-cloud-speech-v2/0.7.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.6.0](/ruby/docs/reference/google-cloud-speech-v2/0.6.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.5.1](/ruby/docs/reference/google-cloud-speech-v2/0.5.1/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.4.0](/ruby/docs/reference/google-cloud-speech-v2/0.4.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.3.0](/ruby/docs/reference/google-cloud-speech-v2/0.3.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.2.0](/ruby/docs/reference/google-cloud-speech-v2/0.2.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest)\n- [0.1.0](/ruby/docs/reference/google-cloud-speech-v2/0.1.0/Google-Cloud-Speech-V2-StreamingRecognizeRequest) \nReference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::StreamingRecognizeRequest.\n\nRequest message for the\n[StreamingRecognize](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Client#Google__Cloud__Speech__V2__Speech__Client_streaming_recognize_instance_ \"Google::Cloud::Speech::V2::Speech::Client#streaming_recognize (method)\")\nmethod. Multiple\n[StreamingRecognizeRequest](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest \"Google::Cloud::Speech::V2::StreamingRecognizeRequest (class)\")\nmessages are sent in one call.\n\n\nIf the [Recognizer](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer \"Google::Cloud::Speech::V2::Recognizer (class)\") referenced by\n[recognizer](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_recognizer_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer (method)\")\ncontains a fully specified request configuration then the stream may only\ncontain messages with only\n[audio](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_audio_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio (method)\") set.\n\n\u003cbr /\u003e\n\nOtherwise the first message must contain a\n[recognizer](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_recognizer_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer (method)\") and\na\n[streaming_config](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_streaming_config_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config (method)\")\nmessage that together fully specify the request configuration and must not\ncontain [audio](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_audio_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio (method)\"). All\nsubsequent messages must only have\n[audio](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest#Google__Cloud__Speech__V2__StreamingRecognizeRequest_audio_instance_ \"Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio (method)\") set. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #audio\n\n def audio() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Inline audio bytes to be Recognized. Maximum size for this field is 15 KB per request.\n\n Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #audio=\n\n def audio=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Inline audio bytes to be Recognized. Maximum size for this field is 15 KB per request.\n\n\nNote: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- Inline audio bytes to be Recognized. Maximum size for this field is 15 KB per request.\n\n Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #recognizer\n\n def recognizer() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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.\n\n### #recognizer=\n\n def recognizer=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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. \n**Returns**\n\n- (::String) --- 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.\n\n### #streaming_config\n\n def streaming_config() -\u003e ::Google::Cloud::Speech::V2::StreamingRecognitionConfig\n\n**Returns**\n\n- ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](./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.\n\n\n Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #streaming_config=\n\n def streaming_config=(value) -\u003e ::Google::Cloud::Speech::V2::StreamingRecognitionConfig\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](./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.\n\n\nNote: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](./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.\n\n\n Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared."]]