public class SpeechClient : ClientBase<Speech.SpeechClient>Client for Speech
Namespace
Google.Cloud.Speech.V1Assembly
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 |
CallInvokerThe callInvoker to use to make remote calls. |
SpeechClient(Channel)
[Obsolete("This constructor overload is present for compatibility only, and will be removed in the next major version")]
public SpeechClient(Channel channel)Creates a new client using a channel.
| Parameter | |
|---|---|
| Name | Description |
channel |
Grpc.Core.ChannelThe channel to use to make remote calls. |
SpeechClient(ChannelBase)
public SpeechClient(ChannelBase channel)Creates a new client for Speech
| Parameter | |
|---|---|
| Name | Description |
channel |
ChannelBaseThe channel to use to make remote calls. |
SpeechClient(ClientBase.ClientBaseConfiguration)
protected SpeechClient(ClientBase.ClientBaseConfiguration configuration)Protected constructor to allow creation of configured clients.
| Parameter | |
|---|---|
| Name | Description |
configuration |
ClientBase.ClientBaseConfigurationThe client configuration. |
Methods
CreateOperationsClient()
public virtual Operations.OperationsClient CreateOperationsClient()Creates a new instance of Operations.OperationsClient using the same call invoker as this client.
| Returns | |
|---|---|
| Type | Description |
Operations.OperationsClient |
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.
| Parameters | |
|---|---|
| Name | Description |
request |
LongRunningRecognizeRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
Operation |
The response received from the server. |
LongRunningRecognize(LongRunningRecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Operation LongRunningRecognize(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))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.
| Parameters | |
|---|---|
| Name | Description |
request |
LongRunningRecognizeRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
Nullable<DateTime>An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
Operation |
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.
| Parameters | |
|---|---|
| Name | Description |
request |
LongRunningRecognizeRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCall<Operation> |
The call object. |
LongRunningRecognizeAsync(LongRunningRecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Operation> LongRunningRecognizeAsync(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))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.
| Parameters | |
|---|---|
| Name | Description |
request |
LongRunningRecognizeRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
Nullable<DateTime>An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCall<Operation> |
The call object. |
NewInstance(ClientBase.ClientBaseConfiguration)
protected override Speech.SpeechClient NewInstance(ClientBase.ClientBaseConfiguration configuration)Creates a new instance of client from given ClientBaseConfiguration.
| Parameter | |
|---|---|
| Name | Description |
configuration |
ClientBase.ClientBaseConfiguration |
| Returns | |
|---|---|
| Type | Description |
Speech.SpeechClient |
|
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 |
RecognizeRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
RecognizeResponse |
The response received from the server. |
Recognize(RecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual RecognizeResponse Recognize(RecognizeRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))Performs synchronous speech recognition: receive results after all audio has been sent and processed.
| Parameters | |
|---|---|
| Name | Description |
request |
RecognizeRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
Nullable<DateTime>An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
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 |
RecognizeRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCall<RecognizeResponse> |
The call object. |
RecognizeAsync(RecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<RecognizeResponse> RecognizeAsync(RecognizeRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))Performs synchronous speech recognition: receive results after all audio has been sent and processed.
| Parameters | |
|---|---|
| Name | Description |
request |
RecognizeRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
Nullable<DateTime>An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCall<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 |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> |
The call object. |
StreamingRecognize(Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> StreamingRecognize(Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))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 |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
Nullable<DateTime>An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> |
The call object. |