We need a way to submit the audio data to the sound card, so that we can hear the resulting sound. We could use a very low-level audio API, such as PortAudio, which provides the bare minimum functionality required to communicate with an audio device. However, FMOD is also perfectly capable of handling this task, and since we have been using it so far, there is little benefit in changing to a different API now. Therefore, we will use FMOD once again, but only as bridge between the application and the hardware, and our code will handle all of the processing.
The way FMOD allows us to play user created audio data is by first creating a sound with the FMOD_OPENUSER
flag, and specifying a callback function that will provide the audio data to the sound.
We must create and fill a FMOD_CREATESOUNDEXINFO
structure with a few details regarding the audio data that we will be submitting, such as the sampling rate, format, and number of channels, as well as a pointer to the function...