Search code examples
c#interopfmod

Creating Events in FMOD from C#


I am trying learn how to create a FMOD event from C# that is visible from the FMOD studio, so that a Audio Engineer I am working with on a hobby project can manage the sound of my entire game without my help. Is there any way to do this from C#? I am currently using the official wrapper for FMOD.

EDIT: This is as far as I have gotten:

        FMOD.RESULT result7 = FMOD.Studio.System.create(out FMOD.Studio.System a);
        FMOD.RESULT result6 = a.initialize(1, INITFLAGS.NORMAL, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
        FMOD.RESULT result = a.loadBankFile(FileSystemManager.RootDirectory + "/Content/Banks/Master Bank.bank", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out Bank testBank);
        FMOD.RESULT result5 = testBank.getEventList(out EventDescription[] someArray);
        FMOD.RESULT result4 = someArray[0].createInstance(out EventInstance instance);
        FMOD.RESULT result3 = instance.setVolume(1F);
        FMOD.RESULT result2 = instance.start();

However, it doesn't play the sound I attached to the event in the Studio. Any ideas?

If you wish to check out my project, you can check it out here,

Thanks!


Solution

  • Calling update() every frame on my instance of FMOD.Studio.System fixed the issue for me.