bool sound_status = false;
SoundPlayer myplay = new SoundPlayer();
private void play_sound_loop(string str) //循环播放 str存放wav文件的路径
{
myplay.SoundLocation = str;
myplay.LoadAsync();
if (sound_status)
myplay.PlayLooping();
else
myplay.Stop();
}
private void play_sound_one(string str) //只播放一次
{
myplay.SoundLocation = str;
myplay.LoadAsync();
if (sound_status)
myplay.Play();
else
myplay.Stop();
}