As I understand it it’s the AudioIODeviceCallback::audioDeviceIOCallback that is called by the audio driver to fill an AudioBuffer with sample data.
If there was the inheritance diagram available on the API doc (samuels alternative doc), you could see, that either AudioProcessorPlayer or AudioSourcePlayer are possible callbacks for the audio driver.
The problem is, if you have connected it to an AudioSource, then each time getNextAudioBlock advances the played material, so you cannot call this from two separate threads without creating a mess.
In this case be sure not to use any BufferingAudioSource, because they will deliver silence, if they didn’t get the chance to buffer new data while the last block gets played back.
I suggested once a wait method, which I called like:
if (isNonRealtime())
waitForNextAudioBlockReady (info);
getNextAudioBlock (info);
That way I can use the same sources and spread the loading on different cores via TimeSliceThreads.
Here is the wait method:
