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
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 |
CallInvoker The callInvoker to use to make remote calls. |
SpeechClient(ChannelBase)
public SpeechClient(ChannelBase channel)
Creates a new client for Speech
Parameter | |
---|---|
Name | Description |
channel |
ChannelBase 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 |
ClientBaseClientBaseConfiguration 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request |
LongRunningRecognizeRequest The request to send to the server. |
options |
CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request |
LongRunningRecognizeRequest The request to send to the server. |
headers |
Metadata 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 |
CancellationToken An 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 |
LongRunningRecognizeRequest The request to send to the server. |
options |
CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request |
LongRunningRecognizeRequest The request to send to the server. |
headers |
Metadata 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 |
CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCallOperation |
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 |
ClientBaseClientBaseConfiguration |
Returns | |
---|---|
Type | Description |
SpeechSpeechClient |
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 |
RecognizeRequest The request to send to the server. |
options |
CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
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 |
RecognizeRequest The request to send to the server. |
headers |
Metadata 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 |
CancellationToken An 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 |
RecognizeRequest The request to send to the server. |
options |
CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request |
RecognizeRequest The request to send to the server. |
headers |
Metadata 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 |
CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
options |
CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
headers |
Metadata 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 |
CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncDuplexStreamingCallStreamingRecognizeRequestStreamingRecognizeResponse |
The call object. |