public SoundPlayer_FMOD() { uint version = 0; FMOD.RESULT result; // Create a System object and initialize. result = FMOD.Factory.System_Create(ref FModSystem); if (!ERRCHECK(result)) { return; } result = FModSystem.getVersion(ref version); if (!ERRCHECK(result)) { return; } if (version < FMOD.VERSION.number) { //Framework.Log.ApplicationLogSink.Write("FMOD Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + FMOD.VERSION.number.ToString("X") + "."); return; } result = FModSystem.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null); if (!ERRCHECK(result)) { return; } }
public override void Dispose() { base.Dispose(); FMOD.RESULT result; foreach (var snd in Sounds) { if (snd != null) { snd.release(); } } Sounds.Clear(); if (FModSystem != null) { result = FModSystem.close(); ERRCHECK(result); result = FModSystem.release(); ERRCHECK(result); } }