Google Cloud Speech v1 API - Class Speech.SpeechClient (3.1.0)

public class SpeechClient : ClientBase<Speech.SpeechClient>

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

Client for Speech

Inheritance

Object > ClientBase > ClientBase<Speech.SpeechClient> > Speech.SpeechClient

Namespace

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
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

SpeechClient(ChannelBase)

public SpeechClient(ChannelBase channel)

Creates a new client for Speech

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

SpeechClient(ClientBase.ClientBaseConfiguration)

protected SpeechClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration

The 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
TypeDescription
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
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

LongRunningRecognize(LongRunningRecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Operation LongRunningRecognize(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = null, 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
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Operation>

The call object.

LongRunningRecognizeAsync(LongRunningRecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Operation> LongRunningRecognizeAsync(LongRunningRecognizeRequest request, Metadata headers = null, DateTime? deadline = null, 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
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
configurationClientBase.ClientBaseConfiguration
Returns
TypeDescription
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
NameDescription
requestRecognizeRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
RecognizeResponse

The response received from the server.

Recognize(RecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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

Parameters
NameDescription
requestRecognizeRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestRecognizeRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<RecognizeResponse>

The call object.

RecognizeAsync(RecognizeRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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

Parameters
NameDescription
requestRecognizeRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse>

The call object.

StreamingRecognize(Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse> StreamingRecognize(Metadata headers = null, DateTime? deadline = null, 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
NameDescription
headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncDuplexStreamingCall<StreamingRecognizeRequest, StreamingRecognizeResponse>

The call object.