O'Reilly logo

Getting Started with C++ Audio Programming for Game Development by David Gouveia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Positional audio in FMOD

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.

Creating an audio source

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required