首页 > 代码库 > C#、VB.NET 使用System.Media.SoundPlayer播放音乐

C#、VB.NET 使用System.Media.SoundPlayer播放音乐

    

        C#、VB.NET 使用System.Media.SoundPlayer播放音乐                         

            标签:               vb.netc#音乐                     
本文章已收录于:        
 
<style>.embody { padding: 10px 10px 10px; margin: 0 -20px; border-bottom: solid 1px #ededed } .embody_b { margin: 0; padding: 10px 0 } .embody .embody_t,.embody .embody_c { display: inline-block; margin-right: 10px } .embody_t { font-size: 12px; color: #999 } .embody_c { font-size: 12px } .embody_c img,.embody_c em { display: inline-block; vertical-align: middle } .embody_c img { width: 30px; height: 30px } .embody_c em { margin: 0 20px 0 10px; color: #333; font-style: normal }</style>

    
      

技术分享             分类:        
作者同类文章X
                               

                

     同步播放:

    System.Media.SoundPlayer player = new System.Media.SoundPlayer();
    player.SoundLocation = @"d:/music/happy.wav";
    player.Load();
    player.Play();

    技术分享 异步播放:

    System.Media.SoundPlayer player = new System.Media.SoundPlayer();
    player.SoundLocation = @"d:/music/happy.wav";
    player.LoadAsync();
    player.PlaySync();

    技术分享 循环播放:

    System.Media.SoundPlayer player = new System.Media.SoundPlayer();
    player.SoundLocation = @"d:/music/happy.wav";
    player.Load();
    player.PlayLooping();

    C#、VB.NET 使用System.Media.SoundPlayer播放音乐