AudioState Enumeration
Enumerates values of the recognizer's audio state.
Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)
Syntax
'Declaration
Public Enumeration AudioState
public enum AudioState
public enum class AudioState
public enum AudioState
public enum AudioState
Members
Member name | Description |
---|---|
Silence | Indicates audio input that is either silence, or non-speech background noise. |
Speech | Indicates speech in the audio input. |
Stopped | Indicates the recognition engine is not currently processing audio input. |
Remarks
Instances of AudioState are obtained from the State property of the AudioStatus class.
The Silence member of the AudioState enumeration indicates no input, or input which is not speech, such as background noise.
An AudioStatusChanged
event (AudioStatusChanged or AudioStatusChanged) is generated whenever a recognition engine AudioState state changes.
Example
In the example below on the AudioStatusChanged event displays the input level and the audio status of the recognition engine when the audio status has been updated. The AudioState value is obtained from the State property on the AudioStatus class.
// Updates the audio level meter and audio state when the audio status has been updated.
_recognizer.AudioStatusChanged +=
delegate(object sender, AudioStatusChangedEventArgs eventArgs) {
_audioLevelProgressBar.ForeColor = ForeColor;
_audioLevelProgressBar.Value = eventArgs.AudioStatus.Level;
_audioStatusChangedEventArgs = eventArgs;
_audioStateLabel.Text = String.Format("Audio State: {0}",
_recognizer.AudioStatus.State.ToString());
};
Platforms
Development Platforms
Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition
Target Platforms
See Also
Reference
Microsoft.Speech.Recognition Namespace
AudioState Enumeration
State
AudioStatusChanged
AudioStatusChanged