Exemple #1
0
        public override void Initialize()
        {
            base.Initialize();

            System.Init(32);

            sounds[0] = System.CreateSound(MediaPath("drumloop.wav"), Mode.Loop_Normal);
            sounds[1] = System.CreateSound(MediaPath("jaguar.wav"), Mode.Loop_Normal);
            sounds[2] = System.CreateSound(MediaPath("swish.wav"), Mode.Loop_Normal);
            sounds[3] = System.CreateSound(MediaPath("c.ogg"), Mode.Loop_Normal);
            sounds[4] = System.CreateSound(MediaPath("d.ogg"), Mode.Loop_Normal);
            sounds[5] = System.CreateSound(MediaPath("e.ogg"), Mode.Loop_Normal);

            A      = System.CreateChannelGroup("Group A");
            B      = System.CreateChannelGroup("Group B");
            Master = System.MasterChannelGroup;

            //Instead of being independent, set the group A and B to be children of the master group.
            Master.AddGroup(A, false);
            Master.AddGroup(B, false);

            for (int i = 0; i < 6; ++i)
            {
                channels[i] = System.PlaySound(sounds[i], i < 3 ? A : B);
            }

            //Change the volume of each group, just because we can! (reduce overall noise).
            A.Volume = 0.5f;
            B.Volume = 0.5f;
        }