Esempio n. 1
0
        public static Sound Add(Sound.Name name, string filename)
        {
            SoundMan sMan  = SoundMan.privGetInstance();
            Sound    sound = (Sound)sMan.AddToFront();

            IrrKlang.ISoundSource source = sMan.engine.AddSoundSourceFromFile(filename);
            source.DefaultVolume = 0.1f;
            sound.Initialize(name, source);
            return(sound);
        }
Esempio n. 2
0
        public static void PlaySound(Sound.Name name, float volume = 1.0f)
        {
            Debug.Assert(name != Sound.Name.Uninitialized);
            SoundMan sMan  = SoundMan.privGetInstance();
            Sound    pHead = (Sound)sMan.pActive;

            while (pHead != null)
            {
                if (pHead.name == name)
                {
                    IrrKlang.ISound sound = sMan.engine.Play2D(pHead.source, false, false, false);
                }

                pHead = (Sound)pHead.pNext;
            }
        }