void Button3Click(object sender, EventArgs e) { MediaFile mediaFile = new SoundFile("resources\\track.wma"); mediaFile.Play(); System.Threading.Thread.Sleep(3000); mediaFile.Stop(); }
private void PlayWarningSound() { String soundFile = Properties.Settings.Default.Sound4CompletingBreak; if (soundFile != "") { try { SoundFile sound = new SoundFile(soundFile); sound.Play(); } catch (Exception ex) { log.Error("Could not play music!", ex); } } }