RecognizeMode 枚举

定义

枚举识别模式的值。

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

字段

Multiple 1

指定了不在完成之后终止的识别。

Single 0

指定了不在完成之后终止的识别。

示例

下面的示例演示如何实现具有图形用户界面并使用的应用程序的 "开始/停止" 按钮 SpeechRecognitionEngine 。 根据应用程序的状态,在 RecognizeAsync(RecognizeMode) 单击该按钮时,将会调用 "单个" 或 "多个"。

private void _startRecogButton_Click(object sender, EventArgs eventArgs)   
{  

  // Toggle speech recognition on.  
  if (_startRecogButton.Text == "Start Speech Recognition")   
  {       
    _startRecogButton.Text = "Stop Speech Recognition";  
    if (_useMultiple)   
    {  
      _recognitionEngine.RecognizeAsync(RecognizeMode.Multiple);  
    }   
    else   
    {  
      _recognitionEngine.RecognizeAsync(RecognizeMode.Single);  
    }  
  }  

  // Toggle speech recognition off.   
  else   
  {                                                        
    _startRecogButton.Text = "Start Speech Recognition";  

    // Stop after current phrase is finished.  
    if (_friendlyStop)   
    {       
      _recognitionEngine.RecognizeAsyncStop();   
    }  

    // Stop before current phrase is finished.  
    else   
    {        
      _recognitionEngine.RecognizeAsyncCancel();   
    }  
  }  
}  

注解

此枚举用作的参数 RecognizeAsync(RecognizeMode)

适用于

另请参阅