Exemplo n.º 1
0
 public static void StopSound()
 {
     if (CurrentSoundCue != null)
     {
         CurrentSoundCue.Stop(AudioStopOptions.AsAuthored);
         CurrentSoundCue.Dispose();
         CurrentSoundCue = null;
     }
 }
Exemplo n.º 2
0
 //  Plays a new SOUND Cue. Stops old cue if there is one.
 public static void StartSoundCue(string cueName)
 {
     if (CurrentSoundCue != null && CurrentSoundCue.IsStopped)
     {
         CurrentSoundCue = null;
     }
     if (CurrentSoundCue != null)
     {
         if (GetPriorityFromCueName(cueName) > GetPriorityFromCueName(CurrentSoundCue.Name))
         {
             StopSound();
             CurrentSoundCue = Sounds.GetCue(cueName);
             CurrentSoundCue.Play();
         }
     }
     else
     {
         CurrentSoundCue = Sounds.GetCue(cueName);
         CurrentSoundCue.Play();
     }
 }