# Cloud Speech-to-Text V2 API - Class Google::Cloud::Speech::V2::StreamingRecognizeRequest (v1.8.0)

1.8.0 (latest) 1.7.1 1.6.0 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.1 0.16.0 0.15.0 0.14.0 0.13.1 0.12.0 0.11.0 0.10.0 0.9.2 0.8.0 0.7.0 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::StreamingRecognizeRequest.

Request message for the
[StreamingRecognize](https://docs.cloud.google.com/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)")
method. Multiple
[StreamingRecognizeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-StreamingRecognizeRequest "Google::Cloud::Speech::V2::StreamingRecognizeRequest (class)")
messages are sent in one call.


If the [Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)") referenced by
[recognizer](https://docs.cloud.google.com/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)")
contains a fully specified request configuration then the stream may only
contain messages with only
[audio](https://docs.cloud.google.com/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.

<br />

Otherwise the first message must contain a
[recognizer](https://docs.cloud.google.com/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
a
[streaming_config](https://docs.cloud.google.com/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)")
message that together fully specify the request configuration and must not
contain [audio](https://docs.cloud.google.com/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
subsequent messages must only have
[audio](https://docs.cloud.google.com/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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #audio

    def audio() -> ::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=

    def audio=(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

    def recognizer() -> ::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=

    def recognizer=(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.

### #streaming_config

    def streaming_config() -> ::Google::Cloud::Speech::V2::StreamingRecognitionConfig

**Returns**

- ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/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.


  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.

### #streaming_config=

    def streaming_config=(value) -> ::Google::Cloud::Speech::V2::StreamingRecognitionConfig

**Parameter**

- **value** ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/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.


  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.
**Returns**

- ([::Google::Cloud::Speech::V2::StreamingRecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/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.


  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.