How do you play audio from a MixerAudioSource?

I’m working on an audio app for my university project. It’s an AudioAppComponent, so not a plugin.
I want to mix an array of AudioTransportSource objects into a MixerAudioSource and then play the final result, but I can’t seem to do it.

I thought it would be as simple as doing something like this (rough pseudocode)…

OwnedArray transportArray;
MixerAudioSource mixer;

load files into AudioTransportSource
iterate through array and do mixer.addInputSource(i)

then in the getNextAudioBlock function call mixer.getNextAudioBlock(bufferToFill)

but I don’t seem to be getting any result. Any help? Thanks :slight_smile:

It is actually that easy, you described the flow correctly.

Just a word of warning that AudioTransportSources are asynchronously, so they are not musically sensible. The start and stop events are subject to jitter at the rate of the getNextAudioBlock() calls from the driver.

Thanks for the reply :slight_smile:

I guess I must be doing something wrong if I’m getting no audio feedback though :confused: