错误代码
private void PlayMusic(Stream ms) { SoundPlayer player = new SoundPlayer(); player.Stream = ms; player.PlaySync(); }
改正后代码
private void PlayMusic(Stream ms) { SoundPlayer player = new SoundPlayer(); ms.Position = 0; player.Stream = null; player.Stream = ms; player.PlaySync(); }
文章评论