Exemple #1
0
        public SoundSource(FMOD.System system, FMOD.Sound sound, int posx, int posy)
        {
            FMOD.RESULT result;

            mPos.x = posx;
            mPos.y = posy;
            mPos.z = 0;

            mVel.x = 0;
            mVel.y = 0;
            mVel.z = 0;

            mSystem = system;

            result = system.playSound(FMOD.CHANNELINDEX.FREE, sound, true, ref mChannel);
            VirtualVoices.ERRCHECK(result);

            SetPosition(mPos.x, mPos.y);

            Random r = new Random(posx);

            result = mChannel.setFrequency(r.Next(22050, 44100));
            VirtualVoices.ERRCHECK(result);

            result = mChannel.setPaused(false);
            VirtualVoices.ERRCHECK(result);

            mBrushBlue = new SolidBrush(Color.Blue);
            mBrushRed  = new SolidBrush(Color.Red);
        }
Exemple #2
0
        private void trackBarFrequency_Scroll(object sender, System.EventArgs e)
        {
            FMOD.RESULT result;

            if (channel != null)
            {
                result = channel.setFrequency((float)trackBarFrequency.Value);
                ERRCHECK(result);
            }
        }