SoundPlayer.Stop() hangs, buzzes

I play sound via SoundPlayer and stop it when a button is clicked. Parallel some timers are running in the background. On some computers the sound hangs (not the application, sort of buzzing), when stop is clicked. On some it works as excepted.

 SoundPlayer snd;

 private void button2_Click(object sender, EventArgs e)
 {
     snd = new SoundPlayer("mywave.wav");
     snd.Play();
 }

 private void button2_Click(object sender, EventArgs e)
 {
     snd.Stop(); // stops, but last sound is played in endless loop (hangs) on some machines
 }
链接地址: http://www.djcxy.com/p/25998.html

上一篇: 不再在远程删除本地分支

下一篇: SoundPlayer.Stop()挂起,嗡嗡声