private void Form1_Load(object sender, System.EventArgs e) { uint version = 0; FMOD.RESULT result; /* * Create a System object and initialize. */ result = FMOD.Factory.System_Create(ref system); ERRCHECK(result); result = system.getVersion(ref version); ERRCHECK(result); if (version < FMOD.VERSION.number) { MessageBox.Show("Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + FMOD.VERSION.number.ToString("X") + "."); Application.Exit(); } result = system.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null); ERRCHECK(result); result = system.createSound("../../../../../examples/media/drumloop.wav", FMOD.MODE.SOFTWARE | FMOD.MODE.LOOP_NORMAL, ref sound); ERRCHECK(result); result = system.playSound(FMOD.CHANNELINDEX.FREE, sound, false, ref channel); ERRCHECK(result); /* * Create DSP unit */ cohar[] nameArray = new char[32]; dspname.ToCharArray().CopyTo(nameArray, 0); dspdesc.name = nameArray; dspdesc.channels = 0; dspdesc.read = dspreadcallback; result = system.createDSP(ref dspdesc, ref mydsp); ERRCHECK(result); result = system.addDSP(mydsp, ref dspconnectiontemp); ERRCHECK(result); result = mydsp.setActive(true); ERRCHECK(result); result = mydsp.setBypass(true); ERRCHECK(result); }
private void lowpass_CheckedChanged(object sender, System.EventArgs e) { FMOD.RESULT result; bool active = false; result = dsplowpass.getActive(ref active); ERRCHECK(result); if (active) { result = dsplowpass.remove(); ERRCHECK(result); } else { result = system.addDSP(dsplowpass, ref dspconnectiontemp); ERRCHECK(result); } }