AudioState Enumeration
Enumerates values of the recognizer's audio state.
Assembly: System.Speech (in System.Speech.dll)
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.
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());
};
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.