private static void Say(System.Globalization.CultureInfo culture, string text) { var prompt = new System.Speech.Synthesis.PromptBuilder(culture); prompt.StartSentence(); prompt.AppendText(text); prompt.EndSentence(); speech.SpeakAsync(prompt); }
private static void Say(string text) { if (speech.State == System.Speech.Synthesis.SynthesizerState.Speaking) { speech.SpeakAsyncCancelAll(); } var prompt = new System.Speech.Synthesis.PromptBuilder(); prompt.StartSentence(); prompt.AppendText(text); prompt.EndSentence(); speech.SpeakAsync(prompt); }