RecognizeMode Enum
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values of the recognition mode.
public enum class RecognizeMode
public enum RecognizeMode
type RecognizeMode =
Public Enum RecognizeMode
- Inheritance
Name | Value | Description |
---|---|---|
Single | 0 | Specifies that recognition terminates after completion. |
Multiple | 1 | Specifies that recognition does not terminate after completion. |
The following example shows the implementation of a start/stop button for an application that has a graphical user interface and uses SpeechRecognitionEngine. 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();
}
}
}
This enumeration is used as an argument to RecognizeAsync(RecognizeMode).
製品 | バージョン |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。