juce_ios_Audio bug (patch suggested)


I have just been experimenting again with iOS audio. This involves using a simple sound generating app with an AudioDeveiceSelectorComponent. If you set the number of active input and output channels to zero, you hit an assertion from here . . .

void prepareFloatBuffers() { floatData.setSize (numInputChannels + numOutputChannels, actualBufferSize); // <-- setSize doesn't like this to be zero zeromem (inputChannels, sizeof (inputChannels)); zeromem (outputChannels, sizeof (outputChannels));

Easily fixed with this (or similar)

void prepareFloatBuffers() { if(!(numInputChannels+numOutputChannels)) return; floatData.setSize (numInputChannels + numOutputChannels, actualBufferSize);


Thanks, I’ll make sure that’s sorted out!


Turns out that patch is not so great, because if you open enable a channel again while the device is running to get a bad access from the RemoteIO thread here . . . .

else if (numOutputChannels == 1) { for (UInt32 i = 0; i < numFrames; ++i) { const short s = (short) (outputChannels[monoOutputChannelNumber][i] * 32767.0f); //<--Oooops


I don’t see how it can get to that point without having been stopped and restarted, which would rebuild the channel list ?