Audio IO (AudioSourcePlayer) maximum number of channels

I ran into an issue where I created an aggregate device on macOS. The device had a total of 176 channels across four hardware devices. There is no limitation on the size of that aggregate in macOS and core audio, or at least I did not hit that limitation.

Once the device was accessed in juce, the resulting audio callbacks only had 128 channels.

Eventually I discovered that the channel limitation is in AudioSourcePlayer.

float* channels[128];
float* outputChans[128];
const float* inputChans[128];

Since it is in AudioSourcePlayer, possibly it affects mac, win, …all hardware platforms.

As far as I can tell, I can manually change those values above to 176 and it works fine.

So, hopefully this helps someone in the future. And it would be great to have a #define for that maximum, possibly in projucer → modules → juce_audio_devices.