public async Task CompileConstraintsAsync() { SpeechRecognitionResultStatus status = (await SpeechRecognizer.CompileConstraintsAsync()).Status; if (status != SpeechRecognitionResultStatus.Success) { throw Logger.LogException(this.GetType().Name, new InvalidOperationException("Couldn't compile the speech recognition constraints.")); } }
private void OrganizeFeedback(VoiceCommandActivatedEventArgs commandArgs) { if (commandArgs != null) { SpeechRecognitionResult speech = commandArgs.Result; RawText = speech.Text; Mode = SemanticInterpretation("commandMode", speech); SpeechRecognitionConfidence confidence = speech.Confidence; double rawConfidence = speech.RawConfidence; TimeSpan duration = speech.PhraseDuration; DateTimeOffset start = speech.PhraseStartTime; SpeechRecognitionResultStatus status = speech.Status; } else { RawText = Mode = null; } }