# \[FR\] AudioAppComponent::setAudioChannels XmlElement param

**URL:** <https://forum.juce.com/t/fr-audioappcomponent-setaudiochannels-xmlelement-param/19356>\
**Category:** General JUCE discussion\
**Created:** [October 3, 2016, 8:14pm UTC](https://forum.juce.com/t/fr-audioappcomponent-setaudiochannels-xmlelement-param/19356 "2016-10-03T20:14:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [October 3, 2016, 8:14pm UTC](https://forum.juce.com/t/fr-audioappcomponent-setaudiochannels-xmlelement-param/19356/1 "2016-10-03T20:14:04Z")

</div>

Minor change which allows us to recall the deviceManager settings… and is backward compatible…

In the AudioAppComponent header:

```auto
    /** A subclass should call this from their constructor, to set up the audio. */
    void setAudioChannels (int numInputChannels, int numOutputChannels, const XmlElement* const xml = nullptr);
```

and in the AudioAppComponent implementation file:

```auto
void AudioAppComponent::setAudioChannels (int numInputChannels, int numOutputChannels, const XmlElement* const xml)
{
    String audioError = deviceManager.initialise (numInputChannels, numOutputChannels, xml, true);
    jassert (audioError.isEmpty());

    deviceManager.addAudioCallback (&audioSourcePlayer);
    audioSourcePlayer.setSource (this);
}
```

Thanks,

Rail

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [October 4, 2016, 9:01am UTC](https://forum.juce.com/t/fr-audioappcomponent-setaudiochannels-xmlelement-param/19356/2 "2016-10-04T09:01:07Z")

</div>

I’ve added this to develop.

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [October 4, 2016, 9:08am UTC](https://forum.juce.com/t/fr-audioappcomponent-setaudiochannels-xmlelement-param/19356/3 "2016-10-04T09:08:03Z")

</div>

Thanks Fabian!

Cheers,

Rail
