共用方式為


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)

適用於

另請參閱