Hi, it’s about the tutorial project downloaded here: https://docs.juce.com/master/tutorial_audio_device_manager.html
I built it without issue on both Mac and Windows, but if I tried to switch on and off the Input/Output channels of the device, after a few attempt it would always crash.
I traced the issue to something about channel number that the AudioBuffer class doesn’t like:
At line 88, the number of audio i/o channels seems to be hard coded to setAudioChannels( 2, 2), but at the audio block line 104~line 110, the process involves getting new channel counts from deviceManager and use that directly to modify audio buffer.
Out of curiosity I tried to move setAudioChannels from line 88 to line 111 and changed the channel number to setAudioChannels(maxInputChannels, maxOnputChannels), this seemed to fix the crash problem, but then I don’t know if doing it at buffer process is a good idea or not.