# Help with processBlock of a multi-channel app

**URL:** <https://forum.juce.com/t/help-with-processblock-of-a-multi-channel-app/29948>\
**Category:** General JUCE discussion\
**Created:** [October 19, 2018, 10:39pm UTC](https://forum.juce.com/t/help-with-processblock-of-a-multi-channel-app/29948 "2018-10-19T22:39:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [October 20, 2018, 12:16pm UTC](https://forum.juce.com/t/help-with-processblock-of-a-multi-channel-app/29948/2 "2018-10-20T12:16:06Z")

</div>

First the question, is this an app, hosting AudioProcessors or an instrument plugin?  
If it is a plugin, don’t use AudioDeviceManager, since you are not supposed to talk to the AudioDevices directly. The user wants that all plugins respect the routing in the host.

Avoid to inherit the AudioOutEngine from Thread. It is good to offload the work to a background thread, but that’s why you have the TimeSliceThread for. And for that it would be good to create a shared pool of TimeSliceThreads, since you want ideally as many threads as cores. But in this setup you end up with as many threads as instances of your AudioOutEngine.  
Have a look at [SharedResourcePointer](https://docs.juce.com/master/classSharedResourcePointer.html#details) to create that.

If you want to call processBlock (i.e. you are hosting), you can create an AudioBuffer, that is referencing a subset of channels of the multi channel AudioBuffer.

---

_[View the full topic](https://forum.juce.com/t/help-with-processblock-of-a-multi-channel-app/29948)._
