Grammar.SpeechRecognized Grammar.SpeechRecognized Grammar.SpeechRecognized Grammar.SpeechRecognized Event

정의

음성 인식기가 Grammar 개체를 사용하여 인식을 수행할 때 발생했습니다.Raised when a speech recognizer performs recognition using the Grammar object.

public:
 event EventHandler<System::Speech::Recognition::SpeechRecognizedEventArgs ^> ^ SpeechRecognized;
public event EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs> SpeechRecognized;
member this.SpeechRecognized : EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs> 
Public Event SpeechRecognized As EventHandler(Of SpeechRecognizedEventArgs) 

예제

다음 예제에서는 이벤트 처리기를 사용 합니다 Grammar 개체의 SpeechRecognized 이벤트입니다.The following example shows the use of an event handler for the Grammar object's SpeechRecognized event. 인식 결과를 출력 합니다 콘솔합니다.It outputs the recognition results to the console.

public partial class Form1 : Form  
{  
  SpeechRecognitionEngine sre;  

  public Form1()  
  {  
  InitializeComponent();  

  // Create an in-process speech recognizer.  
  sre = new SpeechRecognitionEngine();  

  // Configure input to the speech recognizer.  
  sre.SetInputToDefaultAudioDevice();  

  // Create a simple grammar and load it.  
  Grammar testGrammar = new Grammar(new GrammarBuilder("testing"));  
  sre.LoadGrammarAsync(testGrammar);  

  // Add a handler for the grammar's speech recognized event.  
  testGrammar.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(testGrammar_SpeechRecognized);  

  // Start asynchronous speech recognition.  
  sre.RecognizeAsync();  
  }  

  // Handle the grammar's SpeechRecognized event, output the recognized text.  
  void testGrammar_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)  
  {  
    Console.WriteLine("Recognized text: " + e.Result.Text);  
  }  
}  

설명

음성 인식기 발생을 SpeechRecognized 입력 인식 하는 경우 이벤트입니다.The speech recognizer also raises a SpeechRecognized event when it recognizes input. 합니다 Grammar 개체의 SpeechRecognized 이벤트는 음성 인식기의 이전 SpeechRecognized 이벤트입니다.The Grammar object's SpeechRecognized event is raised prior to the speech recognizer's SpeechRecognized event . 자세한 내용은 참조는 SpeechRecognizer.SpeechRecognized, SpeechRecognitionEngine.SpeechRecognized, 및 RecognizeCompleted 이벤트입니다.For more information, see the SpeechRecognizer.SpeechRecognized, SpeechRecognitionEngine.SpeechRecognized, and RecognizeCompleted events.

항상 특정 문법과 관련 된 모든 작업에 대 한 처리기에서 처리 해야 합니다 Grammar 개체의 SpeechRecognized 이벤트입니다.Any tasks specific to a particular grammar should always be handled by handlers for the Grammar object's SpeechRecognized event.

적용 대상

추가 정보