/// <summary> /// Logs Canceled events /// And sets the TaskCompletionSource to 0, in order to trigger Recognition Stop /// </summary> private void CanceledEventHandler(SpeechRecognitionCanceledEventArgs e, RecoType rt, TaskCompletionSource <int> source) { SpeechCanceledEventArgs eventArgs = new SpeechCanceledEventArgs(); eventArgs.Message = "--- recognition canceled ---"; OnSpeechCanceledEvent(eventArgs); eventArgs.Message = $"CancellationReason: {e.Reason.ToString()}. ErrorDetails: {e.ErrorDetails}."; OnSpeechCanceledEvent(eventArgs); }
/// <summary> /// キャンセルイベントを発生 /// </summary> /// <param name="e"></param> protected virtual void OnSpeechCanceledEvent(SpeechCanceledEventArgs e) { SpeechCanceledEvent?.Invoke(this, e); }