I am implemnenting my special AudioProcessor to use it as a part of special audio channel. I need to set up a number of resources to make my processor capable of sourcing audio data. I tried to use AudioProcessor::prepareToPlay() as a point to do the job. However, I discovered that AudioProcessor::prepareToPlay() is always called with sampleRate=0.0 and estimatedSamplesPerBlock=0. I debugged a bit the code and I found that the reason is in void AudioProcessorGraph::AudioGraphIOProcessor::setParentGraph (). There is the following call applied to the object which instantiates the Audio Channel, in which I agregate my own processor:
setPlayConfigDetails (type == audioOutputNode ? graph->getMainBusNumOutputChannels() : 0,
type == audioInputNode ? graph->getMainBusNumInputChannels() : 0,
Simply saying, getSampleRate(), getBlockSize()) leaves unchanged the relevant values what finally results in sampleRate=0.0 and estimatedSamplesPerBlock=0 constantly passed to my processor.
Is it a bug or I should use a different way to get properly reported sample rate and buffer size.