This topic has not yet been rated - Rate this topic

AudioState Enumeration

Enumerates values of the recognizer's audio state.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public enum AudioState
Member name Description
Stopped Indicates the recognition engine is not currently processing audio input.
Silence Indicates audio input that is either silence, or non-speech background noise.
Speech Indicates speech in the audio input.

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.

.NET Framework

Supported in: 3.5, 3.0

Reference

AudioState
State()
AudioStatusChanged()
AudioStatusChanged()
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ