# Cloud Speech V2 Client - Class StreamingRecognizeRequest (2.5.1)

2.5.1 (latest) 2.5.0 2.4.0 2.3.0 2.2.1 2.1.1 2.0.1 1.20.1 1.19.2 1.18.3 1.16.0 1.15.0 1.14.3 1.13.1 1.12.0 1.11.2 1.10.0 1.9.1 1.8.0 1.7.0 Reference documentation and code samples for the Cloud Speech V2 Client class StreamingRecognizeRequest.

Request message for the
[StreamingRecognize](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.Client.SpeechClient#_Google_Cloud_Speech_V2_Client_SpeechClient__streamingRecognize__)
method. Multiple
[StreamingRecognizeRequest](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest)
messages are sent in one call.

If the [Recognizer](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.Recognizer) referenced by
[recognizer](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getRecognizer__)
contains a fully specified request configuration then the stream may only
contain messages with only
[audio](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__) set.
Otherwise the first message must contain a
[recognizer](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getRecognizer__) and
a
[streaming_config](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getStreamingConfig__)
message that together fully specify the request configuration and must not
contain [audio](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__). All
subsequent messages must only have
[audio](https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognizeRequest#_Google_Cloud_Speech_V2_StreamingRecognizeRequest__getAudio__) set.

Generated from protobuf message `google.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 is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The {recognizer} segment may be set to `_` to use an empty implicit Recognizer. |
| `↳ streaming_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/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. 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` |   |

### getStreamingConfig

StreamingRecognitionConfig to be used in this recognition attempt.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-speech/latest/V2.StreamingRecognitionConfig` |

| **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` |   |

### getStreamingRequest

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |