SpeechUI.SendTextFeedback(RecognitionResult, String, Boolean) 메서드

정의

인식 작업의 상태에 대한 상태 및 설명 텍스트를 Speech 플랫폼 사용자 인터페이스로 보냅니다.

public:
 static bool SendTextFeedback(System::Speech::Recognition::RecognitionResult ^ result, System::String ^ feedback, bool isSuccessfulAction);
public static bool SendTextFeedback(System.Speech.Recognition.RecognitionResult result, string feedback, bool isSuccessfulAction);
static member SendTextFeedback : System.Speech.Recognition.RecognitionResult * string * bool -> bool
Public Shared Function SendTextFeedback (result As RecognitionResult, feedback As String, isSuccessfulAction As Boolean) As Boolean

매개 변수

result
RecognitionResult

유효한 인스턴스입니다 RecognitionResult .

feedback
String

String 를 생성한 인식 작업에 대한 주석을 포함하는 A.RecognitionResultresult

isSuccessfulAction
Boolean

bool 애플리케이션이 인식 작업을 성공으로 간주했는지 여부를 나타내는 값입니다.

반품

true 메서드에 제공된 정보(FeedbackisSuccessfulAction)가 Speech 플랫폼 사용자 인터페이스에 성공적으로 제공되었는지, 작업이 false 실패했는지를 나타냅니다.

예제

다음 예제는 이벤트에 대한 처리기입니다 SpeechRecognized . 이 이벤트는 Grammar 양식의 암호 입력을 처리하도록 설계된 "내 암호는 ..."입니다.

암호가 없거나 유효하지 않은 경우 SendTextFeedback 을 사용하여 오류 정보를 Speech 플랫폼 사용자 인터페이스로 보냅니다.

grammar.SpeechRecognized +=
delegate(object sender, SpeechRecognizedEventArgs eventArgs)
{
  SemanticValue semantics = eventArgs.Result.Semantics;
  RecognitionResult result=eventArgs.Result;

  if (!semantics.ContainsKey("Password"))
  {
    SpeechUI.SendTextFeedback(eventArgs.Result, "No Password Provided", false);
  }
  else
  {
    RecognizedAudio pwdAudio = result.GetAudioForWordRange(
              result.Words[3],
              result.Words[result.Words.Count - 1]);
    MemoryStream pwdMemoryStream = new MemoryStream();
    pwdAudio.WriteToAudioStream(pwdMemoryStream);
    if (!IsValidPwd(pwdMemoryStream))
    {
      string badPwd = System.IO.Path.GetTempPath() + "BadPwd" +
               (new Random()).Next().ToString() + ".wav";
      FileStream waveStream = new FileStream(badPwd, FileMode.Create);
      pwdAudio.WriteToWaveStream(waveStream);
      waveStream.Flush();
      waveStream.Close();
      SpeechUI.SendTextFeedback(eventArgs.Result, "Invalid Password", false);
    }
  }
};

설명

SendTextFeedback 는 입력이 인식된 경우에도 인식 작업이 특정 조건을 충족하지 못했음을 나타내는 데 사용할 수 있습니다.

예를 들어 입력이 완전히 인식되었지만 확인 정보가 잘못된 보안 코드 정보의 확인입니다.

적용 대상