Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AudioState Enumeration

Contains a list of possible states for the audio input to a speech recognition engine.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public enum AudioState
Member nameDescription
StoppedNot processing audio input.
SilenceReceiving silence or non-speech background noise.
SpeechReceiving speech input.

You can obtain the audio input state of the speech recognition engine with the SpeechRecognitionEngine.AudioState and SpeechRecognizer.AudioState properties. The SpeechRecognitionEngine.AudioStateChanged and SpeechRecognizer.AudioStateChanged events are raised when the audio input state of a speech recognition engine changes.

The following example demonstrates an event handler that handles the changing audio state of a speech recognizer.


private SpeechRecognitionEngine sre;

// Initializes the speech recognition engine.
private void Initialize()
{
  sre = new SpeechRecognitionEngine();

  // Add a handler for the AudioStateChanged event.
  sre.AudioStateChanged += new EventHandler<AudioStateChangedEventArgs>(sre_AudioStateChanged);

  // Add other initialization code here.
}

  // Handle the AudioStateChanged event.
  void sre_AudioStateChanged(object sender, AudioStateChangedEventArgs e)
{
  AudioState newState = e.AudioState;

  // Handle event here.
}

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.