Everything that happens inside FMOD is managed by a class named FMOD::System
, which we must start by instantiating with the FMOD::Syste
m_Create()
function:
FMOD::System* system; FMOD::System_Create(&system);
Notice that the function returns the system
object through a parameter. You will see this pattern every time one of the FMOD functions needs to return a value, because they all reserve the regular return value for an error code. We will discuss error checking in a bit, but for now let us get the audio engine up and running.
Now that we have a system
object instantiated, we also need to initialize it by calling the init()
method:
system->init(100, FMOD_INIT_NORMAL, 0);
The first parameter specifies the maximum number of channels to allocate. This controls how many sounds you are able to play simultaneously. You can choose any number for this parameter because the system performs some clever priority management behind the scenes and distributes...