The following assertion is easy to produce if one has a mac and a pair of AirPods around (or any other device with non-standard input sample rate):
- Have AirPods connected and set as the system’s default audio device
- Run JUCE’s DemoRunner
- Choose the “AudioAppDemo”
- Go to the settings. It should show that the AirPods are used for both output and input
- Switch the output to “Built-in Output”. This triggers an assertion
AudioSourcePlayer::audioDeviceIOCallback
because its sample-rate value is zero
This happens because AudioIODeviceCombiner::getAvailableSampleRates()
finds the common rates between the AirPods’ mic {16000}
and the rates of the built in output {44100, 48000, 96000}
(at least with 10.14.6 on a 2016 MacBook Pro), which is {}
, so it returns 0.
Perhaps AudioDeviceSelectorComponent
should automatically disable the input device if choosing an output device that is incompatible with it and vice versa?