Windows服务中如何播放声音

不用多说,直接上代码:

                System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
                sp.SoundLocation = @"D:\tmp\wav\1.wav";
                sp.PlaySync();
                sp.SoundLocation = @"D:\tmp\wav\2.wav";
                sp.PlaySync();
                sp.SoundLocation = @"D:\tmp\wav\3.wav";
                sp.PlaySync();
                sp.Dispose();

 

posted @ 2014-03-21 09:27  浪剑  阅读(855)  评论(0编辑  收藏  举报