static void engine_RecognizeCompleted(object sender, System.Speech.Recognition.RecognizeCompletedEventArgs e) { DMDocument doc = new DMDocument(); DMParagraph paragraph = new DMParagraph(); DictationSyncEngine engine = sender as DictationSyncEngine; if (engine != null) { for (int i = 0; i < engine.Result.Count; i++) { var sentence = engine.Result[i]; DMSentence dmSentence = BuildSentence(i, sentence); paragraph.Inlines.Add(dmSentence); } doc.Blocks.Add(paragraph); } doc.Save(Path.Combine(Environment.CurrentDirectory, "data.xml")); Console.WriteLine("Recognize Completed!"); Console.WriteLine("Press any key to exists!"); }
void SyncEngine_RecognizeCompleted(object sender, System.Speech.Recognition.RecognizeCompletedEventArgs e) { if (this._notifyDictationProgress != null) { this._notifyDictationProgress.RecognizeCompleted(); } if (e != null) { myResetEvent.Set(); } }