What the "AudioAppComponent::setAudioChannels" function does?

It says “We must call this to register the number of input and output channels we need” in the Juce tutorial:Build a white noise generator. If it now has four actual inputs, four actual outputs and we call AudioAppComponent::setAudioChannels(2,2),what it does now? What are the actual 2 inputs and 2 outputs now?

If you mean that if you have an audio interface with 4 inputs and 4 outputs, setAudioChannels(2,2) will attempt to use the first 2 inputs and outputs of the hardware. You have no more control over the used channels with AudioAppComponent alone, unless you know what kind of XmlElement to pass as the 3rd parameter for setAudioChannels. setAudioChannels may also silently fail if you don’t run the app under the debugger.

1 Like