コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }