public static void InitTest()
        {
            Main.WinForm.Invoke(new Action(() =>
            {
                ERRCHECK(result = FMOD.Event_Factory.EventSystem_Create(ref _eventSystem));
                ERRCHECK(result = _eventSystem.init(MAX_CHANNELS, FMOD.INITFLAGS.NORMAL, (IntPtr)null, FMOD.EVENT_INITFLAGS.NORMAL));
                ERRCHECK(result = _eventSystem.getSystemObject(ref _system));

                DbgPrimCamPos          = new DebugPrimitives.DbgPrimWireArrow("FMOD Camera", Transform.Default, Color.Lime);
                DbgPrimCamPos.Category = DebugPrimitives.DbgPrimCategory.SoundEvent;
            }));
        }
Beispiel #2
0
        public static void InitTest()
        {
            if (initialised)
            {
                return;
            }

            Main.WinForm.Invoke(new Action(() =>
            {
                if (eventSystemCreated)
                {
                    Shutdown();
                }

                result = FMOD.Event_Factory.EventSystem_Create(ref _eventSystem);

                if (result == RESULT.OK)
                {
                    eventSystemCreated = true;
                }
                else
                {
                    ERRCHECK(result);
                }

                result = _eventSystem.init(MAX_CHANNELS, FMOD.INITFLAGS.NORMAL, (IntPtr)null, FMOD.EVENT_INITFLAGS.NORMAL);
                if (result == RESULT.ERR_OUTPUT_INIT)
                {
                    DialogManager.DialogOK(null, "Failed to initialize FMOD audio output. " +
                                           "Make sure you have an audio device connected and working and " +
                                           "that no other app is taking exclusive control of the device.\n\n" +
                                           "Once you free the device, select FMOD Sound -> Retry Initialization");
                    initialised = false;
                }
                else if (result == RESULT.OK)
                {
                    initialised = true;
                }
                else
                {
                    ERRCHECK(result);
                }

                ERRCHECK(result = _eventSystem.getSystemObject(ref _system));

                DbgPrimCamPos          = new DebugPrimitives.DbgPrimWireArrow("FMOD Camera", Transform.Default, Color.Lime);
                DbgPrimCamPos.Category = DebugPrimitives.DbgPrimCategory.SoundEvent;
            }));
        }
Beispiel #3
0
        /// <summary>
        /// Init the media path  & eventsystem
        /// </summary>
        #region Constructor(s)
        public FmodFactory()
        {
            // let's create our Event
            result = FMOD.Event_Factory.EventSystem_Create(ref eventsystem);
            ERRCHECK(result);

            // Init the event system object
            result = eventsystem.init(256, FMOD.INITFLAGS.NORMAL, (IntPtr)null, FMOD.EVENT_INITFLAGS.NORMAL);
            ERRCHECK(result);

            // Set the FMOD's default media Path
            result = eventsystem.setMediaPath(path);
            ERRCHECK(result);

            // Load a .fev file exported from FMOD Designer
            result = eventsystem.load("source.fev");
            ERRCHECK(result);

            // Acces to the group data embedded in the .fev file
            result = eventsystem.getGroup("source/Noises", false, ref eventgroup);
            ERRCHECK(result);
        }