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

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 > ClientBase > ClientBaseSpeechSpeechClient > Speech.SpeechClient

Namespace

GoogleCloudGoogle.Cloud.SpeechV1

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(ClientBaseConfiguration)

protected SpeechClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

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
OperationsOperationsClient

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, 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.

Parameters
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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
AsyncUnaryCallOperation

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.

Parameters
NameDescription
requestLongRunningRecognizeRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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
AsyncUnaryCallOperation

The call object.

NewInstance(ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
SpeechSpeechClient
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, 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
NameDescription
requestRecognizeRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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
AsyncUnaryCallRecognizeResponse

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

The request to send to the server.

headersMetadata

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

deadlineDateTime

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
AsyncUnaryCallRecognizeResponse

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
AsyncDuplexStreamingCallStreamingRecognizeRequestStreamingRecognizeResponse

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

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

deadlineDateTime

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
AsyncDuplexStreamingCallStreamingRecognizeRequestStreamingRecognizeResponse

The call object.