RecognitionResult.Audio Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Tanıma sonucuyla ilişkili sesi alır.
public:
property System::Speech::Recognition::RecognizedAudio ^ Audio { System::Speech::Recognition::RecognizedAudio ^ get(); };
public System.Speech.Recognition.RecognizedAudio? Audio { get; }
public System.Speech.Recognition.RecognizedAudio Audio { get; }
member this.Audio : System.Speech.Recognition.RecognizedAudio
Public ReadOnly Property Audio As RecognizedAudio
Özellik Değeri
Tanıma sonucuyla ilişkili ses veya bir veya null örneğin veya EmulateRecognize yöntemlerine EmulateRecognizeAsync yapılan bir çağrıdan tanıyıcının sonucu oluşturarak oluşturması SpeechRecognitionEngineSpeechRecognizer.
Örnekler
Aşağıdaki örnekte SpeechRecognized olayı için bir işleyici ve ilişkili RecognitionResultile ilgili bazı bilgiler gösterilmektedir.
// Handle the SpeechRecognized event.
void SpeechRecognizedHandler(object sender, SpeechRecognizedEventArgs e)
{
if (e.Result == null) return;
// Add event handler code here.
// The following code illustrates some of the information available
// in the recognition result.
Console.WriteLine("Grammar({0}): {1}", e.Result.Grammar.Name, e.Result.Text);
Console.WriteLine("Audio for result:");
Console.WriteLine(" Start time: "+ e.Result.Audio.StartTime);
Console.WriteLine(" Duration: " + e.Result.Audio.Duration);
Console.WriteLine(" Format: " + e.Result.Audio.Format.EncodingFormat);
// Display the semantic values in the recognition result.
foreach (KeyValuePair<String, SemanticValue> child in e.Result.Semantics)
{
Console.WriteLine(" {0} key: {1}",
child.Key, child.Value.Value ?? "null");
}
Console.WriteLine();
// Display information about the words in the recognition result.
foreach (RecognizedWordUnit word in e.Result.Words)
{
RecognizedAudio audio = e.Result.GetAudioForWordRange(word, word);
Console.WriteLine(" {0,-10} {1,-10} {2,-10} {3} ({4})",
word.Text, word.LexicalForm, word.Pronunciation,
audio.Duration, word.DisplayAttributes);
}
// Display the recognition alternates for the result.
foreach (RecognizedPhrase phrase in e.Result.Alternates)
{
Console.WriteLine(" alt({0}) {1}", phrase.Confidence, phrase.Text);
}
}
Açıklamalar
Sesin tanıma sonucundaki belirli bir sözcük aralığıyla ilişkili bir bölümünü almak için yöntemini kullanın GetAudioForWordRange .