Hello,
as in subject there is problem in xCode with casting from AudioBlock to ProcessContextReplacing.
The problem doesn’t happen on Windows in Visual Studio.
I have object:
dsp::IIR::Filter<float> myFilter;
And my code in processBlock() looks like that:
myFilter.process(dsp::ProcessContextReplacing< float >(dsp::AudioBlock<float>( buffer )));
And I get that error:
No matching conversion for functional-style cast from ‘dsp::AudioBlock< float >’ to ‘dsp::ProcessContextReplacing< float >’
I found the solution and to make it work I need to create variable of AudioBlock like that:
dsp::AudioBlock< float > block { buffer };
myFilter.process(dsp::ProcessContextReplacing< float >(block));
And now it works. But I still can’t understand why I can’t construct AudioBlock in place as an parameter for ProcessContext constructor.
I also wonder if it makes the difference for performance between creating variable of AudioBlock and then pass it as an parameter, or constructing it in place?
Intuition tells me that performance is better when we construct in place, but first of all as you see I can’t do that, but secondly maybe my intuition mislead me and there is no difference?


