RecognizedAudio Class
Represents audio input a recognition engine used to generate candidate phrases result.
Assembly: System.Speech (in System.Speech.dll)
Instances of RecognizedAudio are typically obtained from Audio property on an object derived from RecognitionResult and passed by a speech recognition engine to handlers of SpeechHypothesized, SpeechRecognized or SpeechRecognitionRejected events generated by SpeechRecognizer and SpeechRecognitionEngine, as well as SpeechRecognized events generated by Grammar.
Note:
|
|---|
|
Instances of RecognizedAudio obtained by emulated speed recognition are null. For more information on emulated speech recognition, see EmulateRecognize and EmulateRecognizeAsync. |
In the example below, an application first checks to see if the recognition operation has been emulated by determining if the RecognizedAudio object received is non null. If the RecognizedAudio object is non-null information about the recognized audio is written to a [Windows.Forms.Label] for display.
if (result != null) { //Clear
RecognizedAudio resultRecognizedAudio = result.Audio;
if (resultRecognizedAudio == null) {
label.Text += String.Format(
" Emulated input\n");
} else {
label.Text += String.Format(
" Candidate Phrase at: {0} mSec\n" +
" Phrase Length: {1} mSec\n" +
" Input State Time: {2}\n" +
" Input Format: {3}\n",
resultRecognizedAudio.AudioPosition.TotalMilliseconds,
resultRecognizedAudio.Duration.TotalMilliseconds,
resultRecognizedAudio.StartTime.ToShortTimeString(),
resultRecognizedAudio.Format.EncodingFormat.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.
Note: