I’ve been building my app on the latest version of Mac OS/X, with JUCE v5.3.2 and it runs fine when I record through my iMac’s built in microphone. But if I’m recording a second track, it becomes neccessary to use headphones, and so I connect my bluetooth BOSE headphones.
This causes the audio callback to crash immediately on an assertion because it is expecting there to be two output channels but finds only one object in the outputChannelInfo array. You can see this in the screenshot below.
My best guess for why this issue only occurs with this device, is that it is something to do with the fact that these headphone’s input channel forces a sampling rate of 16000 while the recording is enabled. But the output device for the headphones desires a sampling rate of 48000. So, perhaps there was some unforeseen logic error in JUCE’s code that is not handling this situation very well.
Perhaps I’m not making any sense and my observation is not useful, but I can’t think of any other reason why the headset works fine in JUCE so long as I don’t require any input channels. And the headset is working just fine when I use Apple’s Voice Memo app to make a recording. So, there is no hardware issue here, and seemingly no operating system issue. So, it would seem that there is indeed a bug in how JUCE sets up the audio device.
As a workaround, I can always plug my headphones in via a cable, but this doesn’t deal with the main issue: if anybody else chooses to run my app it could crash as soon as they connect their bluetooth headset.