Playing Events in FMOD Soundbanks

Does anyone have any tips or reference material for playing events from FMOD soundbank files? I’m very new to working with audio files (and pretty new to Monogame as well!) and I’m having a tough time getting the sounds from events to actually play. I have something that finds the banks in my project and loads the the first event in the bank just to try and get it working:

studioSystem.loadBankFile(filename, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out bank);
bank.getEventList(out EventDescription[] eventArray);
eventArray[0].createInstance(out FMOD.Studio.EventInstanace instance);

The reply is a little late from the original question, but in case you’re still having trouble:

That should generally work. The part you’re likely missing is loading the Master Bank file. It contains a lot of meta data needed when using other banks. Example:

//Load the master bank
result = studioSystem.loadBankFile( "assets/audio/soundbanks/Desktop/" + "Master", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out _MasterBank );
Debug.Assert(result == FMOD.RESULT.OK );

//Load the bank required
result = studioSystem.loadBankFile( "assets/audio/soundbanks/Desktop/" + "", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out _Bank );
Debug.Assert(result == FMOD.RESULT.OK );

The other important part is to ensure you’re calling studioSystem.update in your Update loop. Otherwise, you the instance you create will always remain in the PLAYBACK_STATE.STARTING and never actually be heard.

And lastly, one huge tip for using FMOD with MonoGame - I’d suggest writing out the debug information to a .txt file. For some reason the FMOD Debug output rarely shows up properly in my Visual Studio output window, even when set to do so. However, setting it to write out to a log file has been extremely helpful for us tracking down issues.

result = FMOD.Debug.Initialize( FMOD.DEBUG_FLAGS.LOG, FMOD.DEBUG_MODE.FILE, null, "solari_fmod_log.txt"
1 Like