Similar to my previous entry for AGT assignment, Legend of Bob: Playing Sound with FMOD, this goes further into the world of FMOD. I needed more control over sound for my Athena engine, and looking more into the FMOD APIs, I discovered that FMOD Ex uses soundbanks, which you can change how the sound is by changing values to variables you setup when creating them.
As well as this, with soundbanks you can link multiple audio sources and get them compiled into a single file that will be loaded with the soundbank, specifying even the maximum number of concurrent streams that should be playable for individual audio. As before, most of this code can be found in the FMOD documentation.
There seems very little support for Mac users when it comes to FMOD, so when you find a version, hold onto it when upgrading, newer versions may just break.
Creating a FMOD Soundbank
Open up FMOD Designer, goto the File menu and select New Project, name this new project “testSoundbank”.
Select and expand the “untitled” folder in the Hierarchy window that is on the Events tab. We need to rename this to something we can remember, so lets rename it to “test” in the property window at the bottom.
If you have done right the change will be reflected in the Hierarchy window.
Again the change will be reflected in the Hierarchy window.
Goto the Sound definitions tab, and right click on the empty space to the left side. Now select Add sound definition(s) from wavetables… and a file open dialog will appear.
There are descriptions of what they do in the documentation.
Right click on the right hand side of “layer00” in the grey box (below where it says “Right-click here to add an event parameter”) and select “Add sound…“.
Make sure to check the box next to the wave bank associated with the wavetable you just imported. And click Build.
After a few moment and a progress bar, a message box saying “Build Complete. Took XX:YY:ZZ” will appear.
If you goto the folder where you created your FMOD project there should be a few new files there. You want the “.FSB” which is the soundbank, and “.FEV” which is event information. These two must be kept together when loading them into your application.
Well that is how to make an FMOD soundbank, on the next page I’ll show you the code for setting up FMOD in code to load and eventually play a sound in a soundbank.