public static void Initialize(int NbChannel) { if (ViewerSettings.ActivateSound) { RESULT result; result = Factory.System_Create(ref system); if (EngineError != null) { EngineError(result); } uint version = 0; result = system.getVersion(ref version); if (EngineError != null) { EngineError(result); } if (version < VERSION.number) { LogTools.WriteError("Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + VERSION.number.ToString("X") + "."); throw new ApplicationException("Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + VERSION.number.ToString("X") + "."); } result = system.init(NbChannel, INITFLAGS.NORMAL, (IntPtr)null); if (EngineError != null) { EngineError(result); } channelMusicCallback = new CHANNEL_CALLBACK(OnEndMusic); channelSoundCallback = new CHANNEL_CALLBACK(OnEndSound); channelVoiceCallback = new CHANNEL_CALLBACK(OnEndVoice); } }