AudioProcessorGraph and prepareToPlay()


#1

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


#2

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