C# 播放声音
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格式的波形
天再高,踮起脚尖就能更接近阳光