Using positional audio in FMOD is not too different from what we have done so far. In fact, we have already used all the classes required for positional audio on the previous chapters; the
FMOD::Channel class already works as an audio source, while the
FMOD::System class controls all the audio listeners in the scene. Let us break down the entire process into steps.
The first point that we have to remember is to create our sounds using the
FMOD_3D flag; otherwise, the 3D audio engine will not process them:
system->createSound("explosion.wav", FMOD_3D, 0, &sound);
Then we simply need to play the sounds as usual, storing a reference to the channel handle so that we can modify the 3D properties of the ...