1.引用程序集 System.Speech
2.引用命名空间
using System.Speech.Synthesis;
3.
SpeechSynthesizer s = new SpeechSynthesizer();
//执行朗读
s.SpeakAsync("测试文本,开始");
//停止朗读
s.SpeakAsyncCancelAll();
2.引用命名空间
using System.Speech.Synthesis;
3.
SpeechSynthesizer s = new SpeechSynthesizer();
//执行朗读
s.SpeakAsync("测试文本,开始");
//停止朗读
s.SpeakAsyncCancelAll();