Example #1
0
 public void StopSound()
 {
     if (asound != null)
     {
         asound.StopAudioEffect();
     }
 }
Example #2
0
 public void PlaySound(string name, bool loop)
 {
     if (paused)
     {
         return;
     }
     if (sounds.ContainsKey(name))
     {
         AudioEffect ass = ((AudioEffect)sounds.Get(name));
         ass.Loop(loop);
         ass.PlayAudioEffect();
     }
     else
     {
         if (clipCount > 50)
         {
             int         idx  = sounds.Size() - 1;
             string      k    = (string)sounds.GetKey(idx);
             AudioEffect clip = (AudioEffect)sounds.Remove(k);
             clip.StopAudioEffect();
             clip = null;
             clipCount--;
         }
         asound = new AudioEffect(name);
         asound.Loop(loop);
         asound.PlayAudioEffect();
         sounds.Put(name, asound);
         clipCount++;
     }
 }
Example #3
0
        public void StopSound(int index)
        {
            AudioEffect sound = (AudioEffect)sounds.Get(index);

            if (sound != null)
            {
                sound.StopAudioEffect();
            }
        }
Example #4
0
 public void StopSoundAll()
 {
     if (sounds != null)
     {
         List <ArrayMap.Entry> list = sounds.ToList();
         for (int i = 0; i < list.Count; i++)
         {
             ArrayMap.Entry sound = list[i];
             if (sound != null)
             {
                 AudioEffect ass = (AudioEffect)sound.GetValue();
                 if (ass != null)
                 {
                     ass.StopAudioEffect();
                 }
             }
         }
     }
 }