Share via


AudioSignalProblem Enumeration

Enumerates the types of audio signal problems.

Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)

Syntax

'Declaration
Public Enumeration AudioSignalProblem
public enum AudioSignalProblem
public enum class AudioSignalProblem
public enum AudioSignalProblem
public enum AudioSignalProblem

Members

Member name Description
None Audio input can be processed by the recognition engine.
NoSignal No audio input is detected.
TooFast Audio input is too fast for the recognition engine to process.
TooLoud Audio input is too loud for the recognition engine to process.
TooNoisy Audio input has too much background noise for the recognition engine to process.
TooSlow Audio input is too slow for the recognition engine to process.
TooSoft Audio input is not loud enough for the recognition engine to process.

Remarks

The SignalProblem property on AudioStatus is used to obtain the audio signal state of input to a recognition engine expressed as a member of the AudioSignalProblem enumeration.

Example

In the example is a diagnostic that displays detailed information about speech recognition operations. The member of the AudioSignalProblem enumeration returned by an instance of AudioStatus (recognizerAudioStatus) is checked, and if problem exist that information is logged.

private void DisplayRecognitionDetails(string eventType, RecognitionResult result, AudioStatus recognizerAudioStatus) {
    String info;
    info = eventType + String.Format("\n");

    if (result.Audio == null || recognizerAudioStatus == null) { //Emulated input

        info += String.Format("  Emulated Speech Input\n");
        _audioStateLabel.Text = "Audio input state:       None";
    } else {
        if (recognizerAudioStatus.SignalProblem != AudioSignalProblem.None) {

            info += String.Format(
                              "Warning: Signal State is \"{0}\"\n", recognizerAudioStatus.SignalProblem.ToString());
        }

        info += String.Format(
                    "  Speech Detected at:        {0} mSec\n" +
                    "  Candidate Phrase at:       {1} mSec\n" +
                    "  Recognizer currently at:   {2} mSec\n" +
                    "  Audio Device currently at: {3} mSec\n",
                    _speechDetectedEventArgs.AudioPosition.TotalMilliseconds,
                    result.Audio.AudioPosition.TotalMilliseconds,
                    recognizerAudioStatus.RecognizerPosition.TotalMilliseconds,
                    recognizerAudioStatus.AudioPosition.TotalMilliseconds);
    }
    info += String.Format("  Confidence Level:          {0}\n", result.Confidence);
    if (result.Grammar != null) {
        info += String.Format(
                          "  Recognizing Grammar:       {0}\n" +
                          "  Recognizing Rule:          {1}\n",
                           ((result.Grammar.Name != null) ? (result.Grammar.Name) : "None"),
                            ((result.Grammar.RuleName != null) ? (result.Grammar.RuleName) : "None"));
    }

    _recognitionEventInfoLabel.Text = info;
}

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
AudioSignalProblem Enumeration
SignalProblem