/// <summary> /// Perform asynchronous speech-recognition: receive results via the /// google.longrunning.Operations interface. Returns either an /// `Operation.error` or an `Operation.response` which contains /// an `AsyncRecognizeResponse` message. /// </summary> /// <param name="config"> /// [Required] The `config` message provides information to the recognizer /// that specifies how to process the request. /// </param> /// <param name="audio"> /// [Required] The audio data to be recognized. /// </param> /// <param name="cancellationToken"> /// A <see cref="CancellationToken"/> to use for this RPC. /// </param> /// <returns> /// A Task containing the RPC response. /// </returns> public virtual Task <Operation <AsyncRecognizeResponse> > AsyncRecognizeAsync( RecognitionConfig config, RecognitionAudio audio, CancellationToken cancellationToken) => AsyncRecognizeAsync( new AsyncRecognizeRequest { Config = config, Audio = audio, }, CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Perform asynchronous speech-recognition: receive results via the /// google.longrunning.Operations interface. Returns either an /// `Operation.error` or an `Operation.response` which contains /// an `AsyncRecognizeResponse` message. /// </summary> /// <param name="config"> /// [Required] The `config` message provides information to the recognizer /// that specifies how to process the request. /// </param> /// <param name="audio"> /// [Required] The audio data to be recognized. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public virtual Operation <AsyncRecognizeResponse> AsyncRecognize( RecognitionConfig config, RecognitionAudio audio, CallSettings callSettings = null) => AsyncRecognize( new AsyncRecognizeRequest { Config = config, Audio = audio, }, callSettings);
/// <summary> /// Perform synchronous speech-recognition: receive results after all audio /// has been sent and processed. /// </summary> /// <param name="config"> /// [Required] The `config` message provides information to the recognizer /// that specifies how to process the request. /// </param> /// <param name="audio"> /// [Required] The audio data to be recognized. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public virtual SyncRecognizeResponse SyncRecognize( RecognitionConfig config, RecognitionAudio audio, CallSettings callSettings = null) => SyncRecognize( new SyncRecognizeRequest { Config = config, Audio = audio, }, callSettings);
/// <summary> /// Perform asynchronous speech-recognition: receive results via the /// google.longrunning.Operations interface. Returns either an /// `Operation.error` or an `Operation.response` which contains /// an `AsyncRecognizeResponse` message. /// </summary> /// <param name="config"> /// [Required] The `config` message provides information to the recognizer /// that specifies how to process the request. /// </param> /// <param name="audio"> /// [Required] The audio data to be recognized. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public override Operation AsyncRecognize( RecognitionConfig config, RecognitionAudio audio, CallSettings callSettings = null) { AsyncRecognizeRequest request = new AsyncRecognizeRequest { Config = config, Audio = audio, }; Modify_AsyncRecognizeRequest(ref request, ref callSettings); return(_callAsyncRecognize.Sync(request, callSettings)); }
/// <summary> /// Perform synchronous speech-recognition: receive results after all audio /// has been sent and processed. /// </summary> /// <param name="config"> /// [Required] The `config` message provides information to the recognizer /// that specifies how to process the request. /// </param> /// <param name="audio"> /// [Required] The audio data to be recognized. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// A Task containing the RPC response. /// </returns> public override Task <SyncRecognizeResponse> SyncRecognizeAsync( RecognitionConfig config, RecognitionAudio audio, CallSettings callSettings = null) { SyncRecognizeRequest request = new SyncRecognizeRequest { Config = config, Audio = audio, }; Modify_SyncRecognizeRequest(ref request, ref callSettings); return(_callSyncRecognize.Async(request, callSettings)); }