# AudioProcessorGraph and prepareToPlay()

**URL:** <https://forum.juce.com/t/audioprocessorgraph-and-preparetoplay/4056>\
**Category:** General JUCE discussion\
**Created:** [June 29, 2009, 8:36pm UTC](https://forum.juce.com/t/audioprocessorgraph-and-preparetoplay/4056 "2009-06-29T20:36:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [June 29, 2009, 8:36pm UTC](https://forum.juce.com/t/audioprocessorgraph-and-preparetoplay/4056/1 "2009-06-29T20:36:00Z")

</div>

I’ve had a few issues connecting audioProcessors …

First, it seems you need to wait until after the setProcessor command has been called on the AudioProcessorGraph to add connections … this makes sense, since prior to assigning it to a processor the number of inputs and outputs is unknown.

If I add a few processors as nodes … then setProcessor … then add connections, I notice another problem … none of the connections are valid! Apparently the processors still don’t know the number of inputs/output. So I guess setProcessor(graph) doesn’t trickle down to init the processors themselves?

I am able to sidestep the issue with the AudioProcessor::setPlayConfigDetails(ins, outs, samplingrate, bufferSize); command … but since the docs say this is “not for public use”, I assume there is another (better?) way to do this?

Anyway, curious what others do here?

PS - I also notice that I get an error if I try the prepareToPlay() method on the graph … it tries to resize to 0 inputs/outputs … which may be related to they above. Seems to work fine without the prepareToPlay() though …

Thanks  
Aaron

---

<div class="post-metadata">

**Author:** ![portscan](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@portscan](https://forum.juce.com/u/portscan)\
**Post date:** [October 5, 2009, 6:01pm UTC](https://forum.juce.com/t/audioprocessorgraph-and-preparetoplay/4056/2 "2009-10-05T18:01:59Z")

</div>

audioProcessor-\>prepareToPlay(graph.getSampleRate(),graph.getBlockSize());
