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();

 

注意,只支持wav格式的波形

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2022-12-23
  • 2020-04-30
  • 2022-12-23
  • 2021-05-30
  • 2021-10-07
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案