Esempio n. 1
0
 public static void unloadSound(ref ExtendedAudioBuffer sound)
 {
     if (sound == null)
     {
         return;
     }
     sound.stop();
     sound.Dispose();
     sound = null;
 }
Esempio n. 2
0
        /// <summary>
        ///  Loads and plays the specified wave file, and disposes it after it is done playing.
        /// </summary>
        /// <param name="fn">The name of the file to play.</param>
        public static void playAndWait(String fn)
        {
            ExtendedAudioBuffer s = LoadSound(fn);

            PlaySound(s, true, false);
            while (isPlaying(s))
            {
                Thread.Sleep(100);
            }
            s.Dispose();
            s = null;
        }