Пример #1
0
 /// <summary>
 /// Handle events fired when a result is generated. This may include a garbage rule that fires when general room noise
 /// or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with
 /// low confidence).
 /// </summary>
 /// <param name="sender">The Recognition session that generated this result</param>
 /// <param name="args">Details about the recognized speech</param>
 private void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender,
                                                           SpeechContinuousRecognitionResultGeneratedEventArgs args)
 {
     if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
         args.Result.Confidence == SpeechRecognitionConfidence.High ||
         args.Result.Confidence == SpeechRecognitionConfidence.Low)
     {
         main.HandleVoiceCommand(args.Result.SemanticInterpretation.Properties);
     }
     else if (args.Result.Confidence == SpeechRecognitionConfidence.Rejected)
     {
         // TODO HANDLE ERROR
     }
 }