RecognizeMode RecognizeMode RecognizeMode RecognizeMode Enum

定義

認識モードの値を列挙します。Enumerates values of the recognition mode.

public enum class RecognizeMode
public enum RecognizeMode
type RecognizeMode = 
Public Enum RecognizeMode
継承
RecognizeModeRecognizeModeRecognizeModeRecognizeMode

フィールド

Multiple Multiple Multiple Multiple 1

完了後も認識が終了しないことを指定します。Specifies that recognition does not terminate after completion.

Single Single Single Single 0

完了後に認識が終了するように指定します。Specifies that recognition terminates after completion.

次の例は、グラフィカル ユーザー インターフェイスを備えを使用しているアプリケーションの開始/停止ボタンの実装を示しています。SpeechRecognitionEngineします。The following example shows the implementation of a start/stop button for an application that has a graphical user interface and uses SpeechRecognitionEngine. アプリケーションの状態に応じてRecognizeAsync(RecognizeMode)ボタンがクリックされたときに、1 つまたは複数のいずれかで呼び出されます。Depending on the state of the application, RecognizeAsync(RecognizeMode) is called with either Single or Multiple when the button is clicked.

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)します。This enumeration is used as an argument to RecognizeAsync(RecognizeMode).

適用対象

こちらもご覧ください