Export (0) Print
Expand All

AudioSignalProblemOccurredEventArgs Class

Provides data for the AudioSignalProblemOccurred event of a SpeechRecognizer or a SpeechRecognitionEngine.

System.Object
  System.EventArgs
    System.Speech.Recognition.AudioSignalProblemOccurredEventArgs

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

public class AudioSignalProblemOccurredEventArgs : EventArgs

The AudioSignalProblemOccurredEventArgs type exposes the following members.

  NameDescription
Public propertyAudioLevelGets the audio level associated with the event.
Public propertyAudioPositionGets the position in the input device's audio stream that indicates where the problem occurred.
Public propertyAudioSignalProblemGets the audio signal problem.
Public propertyRecognizerAudioPositionGets the position in the audio input that the recognizer has received that indicates where the problem occurred.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

An instance of AudioSignalProblemOccurredEventArgs is created when the SpeechRecognitionEngine or SpeechRecognizer object raises an AudioSignalProblemOccurred event. To obtain information related to an AudioSignalProblemOccurred event, access the following properties in the handler for the event:

The AudioPosition property references the input device's position in its generated audio stream. By contrast, the RecognizerAudioPosition property references the recognizer's position within its audio input. These positions can be different. For more information, see Using Speech Recognition Events.

The AudioSignalProblem property indicates which problem occurred.

AudioSignalProblemOccurredEventArgs derives from EventArgs.

The following example defines an event handler that gathers information about an AudioSignalProblemOccurred event.


private SpeechRecognitionEngine sre;

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

  // Add a handler for the AudioSignalProblemOccurred event.
  sre.AudioSignalProblemOccurred += new EventHandler<AudioSignalProblemOccurredEventArgs>(sre_AudioSignalProblemOccurred);
}

// Gather information when the AudioSignalProblemOccurred event is raised.
void sre_AudioSignalProblemOccurred(object sender, AudioSignalProblemOccurredEventArgs e)
{
  StringBuilder details = new StringBuilder();

  details.AppendLine("Audio signal problem information:");
  details.AppendFormat(
    " Audio level:               {0}" + Environment.NewLine +
    " Audio position:            {1}" + Environment.NewLine +
    " Audio signal problem:      {2}" + Environment.NewLine +
    " Recognition engine audio position: {3}" + Environment.NewLine,
    e.AudioLevel, e.AudioPosition,  e.AudioSignalProblem,
    e.RecognizerAudioPosition);

  // Insert additional event handler code 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft