ms speech from command line

前端 未结 7 1756
遥遥无期
遥遥无期 2020-12-02 11:23

Is there a way to use the MS Speech utility from command line? I can do it on a mac, but can\'t find any reference to it on Windows XP.

7条回答
  •  独厮守ぢ
    2020-12-02 11:50

    If you can't find a command you can always wrap the System.Speech.Synthesis.SpeechSynthesizer from .Net 3.0 (Don't forget to reference "System.Speech")

    using System.Speech.Synthesis;
    
    namespace Talk
    {
        class Program
        {
            static void Main(string[] args)
            {
                using (var ss = new SpeechSynthesizer())
                    foreach (var toSay in args)
                        ss.Speak(toSay);
            }
        }
    }
    

提交回复
热议问题