SpeechRecognitionEngine.AudioSignalProblemOccurred 이벤트

정의

SpeechRecognitionEngine가 오디오 신호에서 문제를 감지했을 때 발생했습니다.Raised when the SpeechRecognitionEngine detects a problem in the audio signal.

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

이벤트 유형

EventHandler<AudioSignalProblemOccurredEventArgs>

예제

다음 예제에서는 정의 대 한 정보를 수집 하는 이벤트 처리기는 AudioSignalProblemOccurred 이벤트입니다.The following example defines an event handler that gathers information about an AudioSignalProblemOccurred event.

private SpeechRecognitionEngine recognizer;  

// Initialize the speech recognition engine.  
private void Initialize()  
{  
  recognizer = new SpeechRecognitionEngine();  

  // Add a handler for the AudioSignalProblemOccurred event.  
  recognizer.AudioSignalProblemOccurred +=   
    new EventHandler<AudioSignalProblemOccurredEventArgs>(  
      recognizer_AudioSignalProblemOccurred);  
}  

// Gather information when the AudioSignalProblemOccurred event is raised.  
void recognizer_AudioSignalProblemOccurred(object sender, AudioSignalProblemOccurredEventArgs e)  
{  
  StringBuilder details = new StringBuilder();  

  details.AppendLine("Audio signal problem information:");  
  details.AppendFormat(  
    " Audio level:               {0}" + Environment.NewLine +  
    " Audio position:            {1}" + Environment.NewLine +  
    " Audio signal problem:      {2}" + Environment.NewLine +  
    " Recognition engine audio position: {3}" + Environment.NewLine,  
    e.AudioLevel, e.AudioPosition,  e.AudioSignalProblem,  
    e.recoEngineAudioPosition);  

  // Insert additional event handler code here.  
}  

설명

어떤 문제가 발생 했습니다.을 사용 합니다 AudioSignalProblem 속성은 연결 된 AudioSignalProblemOccurredEventArgs합니다.To get which problem occurred, use the AudioSignalProblem property of the associated AudioSignalProblemOccurredEventArgs.

AudioSignalProblemOccurred 대리자를 만드는 경우 이벤트를 처리할 메서드를 결정합니다.When you create an AudioSignalProblemOccurred delegate, you identify the method that will handle the event. 이벤트를 이벤트 처리기와 연결하려면 대리자의 인스턴스를 해당 이벤트에 추가합니다.To associate the event with your event handler, add an instance of the delegate to the event. 대리자를 제거하지 않는 경우 이벤트가 발생할 때마다 이벤트 처리기가 호출됩니다.The event handler is called whenever the event occurs, unless you remove the delegate. 이벤트 처리기 대리자에 대 한 자세한 내용은 참조 하세요. 이벤트 및 대리자합니다.For more information about event-handler delegates, see Events and Delegates.

적용 대상

추가 정보