# Google Cloud Speech v1 API - Class Speech.SpeechClient (3.9.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.9.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.8.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.7.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.6.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.5.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.4.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.3.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.2.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.1.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/3.0.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.9.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.8.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.7.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.6.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.5.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.4.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.3.0/Google.Cloud.Speech.V1.Speech.SpeechClient)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/2.2.0/Google.Cloud.Speech.V1.Speech.SpeechClient)

    public class Speech.SpeechClient : ClientBase<Speech.SpeechClient>

Reference documentation and code samples for the Google Cloud Speech v1 API class Speech.SpeechClient.

Client for Speech

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html)[Speech](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.Speech)[SpeechClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.Speech.SpeechClient) \> Speech.SpeechClient

## Inherited Members

[ClientBase\<Speech.SpeechClient\>.WithHost(string)](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html#Grpc_Core_ClientBase_CallInvoker) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Speech.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1)

## Assembly

Google.Cloud.Speech.V1.dll

## Constructors

### SpeechClient()

    protected SpeechClient()

Protected parameterless constructor to allow creation of test doubles.

### SpeechClient(CallInvoker)

    public SpeechClient(CallInvoker callInvoker)

Creates a new client for Speech that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallInvoker.html` The callInvoker to use to make remote calls. |

### SpeechClient(ChannelBase)

    public SpeechClient(ChannelBase channel)

Creates a new client for Speech

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelBase.html` The channel to use to make remote calls. |

### SpeechClient(ClientBaseConfiguration)

    protected SpeechClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` The client configuration. |

## Methods

### CreateOperationsClient()

    public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of [Operations.OperationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operations.OperationsClient.html) using the same call invoker as
this client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operations.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operations.OperationsClient.html` | A new Operations client for the same target as this client. |

### LongRunningRecognize(LongRunningRecognizeRequest, CallOptions)

    public virtual Operation LongRunningRecognize(LongRunningRecognizeRequest request, CallOptions options)

Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
`Operation.error` or an `Operation.response` which contains
a `LongRunningRecognizeResponse` message.
For more information on asynchronous speech recognition, see the
[how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.LongRunningRecognizeRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The response received from the server. |

### LongRunningRecognize(LongRunningRecognizeRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation LongRunningRecognize(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
`Operation.error` or an `Operation.response` which contains
a `LongRunningRecognizeResponse` message.
For more information on asynchronous speech recognition, see the
[how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.LongRunningRecognizeRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The response received from the server. |

### LongRunningRecognizeAsync(LongRunningRecognizeRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> LongRunningRecognizeAsync(LongRunningRecognizeRequest request, CallOptions options)

Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
`Operation.error` or an `Operation.response` which contains
a `LongRunningRecognizeResponse` message.
For more information on asynchronous speech recognition, see the
[how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.LongRunningRecognizeRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The call object. |

### LongRunningRecognizeAsync(LongRunningRecognizeRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> LongRunningRecognizeAsync(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
`Operation.error` or an `Operation.response` which contains
a `LongRunningRecognizeResponse` message.
For more information on asynchronous speech recognition, see the
[how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.LongRunningRecognizeRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override Speech.SpeechClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.Speechhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.Speech.SpeechClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Speech.V1.Speech.SpeechClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### Recognize(RecognizeRequest, CallOptions)

    public virtual RecognizeResponse Recognize(RecognizeRequest request, CallOptions options)

Performs synchronous speech recognition: receive results after all audio
has been sent and processed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeResponse` | The response received from the server. |

### Recognize(RecognizeRequest, Metadata, DateTime?, CancellationToken)

    public virtual RecognizeResponse Recognize(RecognizeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Performs synchronous speech recognition: receive results after all audio
has been sent and processed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeResponse` | The response received from the server. |

### RecognizeAsync(RecognizeRequest, CallOptions)

    public virtual AsyncUnaryCall<RecognizeResponse> RecognizeAsync(RecognizeRequest request, CallOptions options)

Performs synchronous speech recognition: receive results after all audio
has been sent and processed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeResponse` | The call object. |

### RecognizeAsync(RecognizeRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<RecognizeResponse> RecognizeAsync(RecognizeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Performs synchronous speech recognition: receive results after all audio
has been sent and processed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.RecognizeResponse` | The call object. |

### StreamingRecognize(CallOptions)

    public virtual AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> StreamingRecognize(CallOptions options)

Performs bidirectional streaming speech recognition: receive results while
sending audio. This method is only available via the gRPC API (not REST).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncDuplexStreamingCall-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.StreamingRecognizeRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.StreamingRecognizeResponse` | The call object. |

### StreamingRecognize(Metadata, DateTime?, CancellationToken)

    public virtual AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> StreamingRecognize(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Performs bidirectional streaming speech recognition: receive results while
sending audio. This method is only available via the gRPC API (not REST).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncDuplexStreamingCall-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.StreamingRecognizeRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Speech.V1/latest/Google.Cloud.Speech.V1.StreamingRecognizeResponse` | The call object. |