AudioSignalProblem 枚举

定义

在转到语音识别引擎的音频信号中包含可能问题列表。

public enum class AudioSignalProblem
public enum AudioSignalProblem
type AudioSignalProblem = 
Public Enum AudioSignalProblem
继承
AudioSignalProblem

字段

None 0

音频输入没有任何问题。

NoSignal 2

未检测到音频输入。

TooFast 5

音频输入太快。

TooLoud 3

音频输入太大声。

TooNoisy 1

音频输入具有太多背景噪音。

TooSlow 6

音频输入太慢。

TooSoft 4

音频输入太安静。

示例

以下示例定义一个事件处理程序,用于收集有关事件 AudioSignalProblemOccurred 的信息。

private SpeechRecognitionEngine sre;  

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

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

// Gather information when the AudioSignalProblemOccurred event is raised.  
void sre_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.  
}  

注解

AudioSignalProblemOccurredEventArgs.AudioSignalProblemSpeechRecognizer 引发AudioSignalProblemOccurred事件时, SpeechRecognitionEngine 属性获取此枚举的成员。

适用于

另请参阅