Esempio n. 1
0
        void Button3Click(object sender, EventArgs e)
        {
            MediaFile mediaFile = new SoundFile("resources\\track.wma");

            mediaFile.Play();
            System.Threading.Thread.Sleep(3000);
            mediaFile.Stop();
        }
Esempio n. 2
0
 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);
         }
     }
 }