c#系統語音播報

首先添加引用,System.Speech

添加using指令:using System.Speech.Synthesis;

之後代碼

            SpeechSynthesizer synth = new SpeechSynthesizer();
            synth.Rate = 1;       //設置語速
            synth.Speak(播報的內容);
            synth.Dispose();     //釋放資源

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章