c# winform播放声音的两种方式

 axWindowsMediaPlayer1.settings.setMode("", true);

axWindowsMediaPlayer1.URL = "skcg.mp3";

//等待时间大概2秒

//异步,主程序不会卡住

//生成语音网址  https://developer.baidu.com/vcast

using System.Speech.Synthesis;

SpeechSynthesizer synth = new SpeechSynthesizer();
synth.Speak("刷卡成功!");

//等待时间大概1.1秒

//同步,主程序会卡住

猜你喜欢

转载自www.cnblogs.com/yangsongyan/p/9664932.html
今日推荐