# What the "AudioAppComponent::setAudioChannels" function does?

**URL:** <https://forum.juce.com/t/what-the-audioappcomponent-setaudiochannels-function-does/34764>\
**Category:** General JUCE discussion\
**Created:** [August 13, 2019, 2:19am UTC](https://forum.juce.com/t/what-the-audioappcomponent-setaudiochannels-function-does/34764 "2019-08-13T02:19:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caoleiwe](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@caoleiwe](https://forum.juce.com/u/caoleiwe)\
**Post date:** [August 13, 2019, 2:19am UTC](https://forum.juce.com/t/what-the-audioappcomponent-setaudiochannels-function-does/34764/1 "2019-08-13T02:19:26Z")

</div>

Hi,  
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?

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [August 13, 2019, 10:41am UTC](https://forum.juce.com/t/what-the-audioappcomponent-setaudiochannels-function-does/34764/2 "2019-08-13T10:41:02Z")

</div>

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.
