原文:C#、VB.NET 使用System.Media.SoundPlayer播放音乐
同步播放:
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();
时间: 2025-01-28 05:28:54