Updating Deprecated Call to copyAndLoadImpulseResponseFromBlock()

Hello, I’m attempting to update this function found in an open source convolution reverb project and I’m having trouble replacing the call to copyAndLoadImpulseResponseFromBlock(). It looks like the new member function of juce::dsp::Convolution I want to use for loading my binary data is this one: JUCE: dsp::Convolution Class Reference
(the docs even say it’s for binary data loaded as a resource), but I’m having trouble figuring out how I should go from the juce::dsp::AudioBlock which is holding the ir data to const void*.

Any advice on how to make the conversion here?

Here’s the full function:

void Convolution::loadIR(AudioBlock ir)
    {
        juce::dsp::ProcessSpec spec;
        spec.sampleRate = processor->getSampleRate();

        spec.maximumBlockSize = 2048;
        spec.numChannels = (juce::uint32)ir.getNumChannels();

        // Must be called before loading the impulse response to provide to the convolution
        // the maximumBufferSize to handle and the sample rate for optional resampling.
        prepare(spec);

        copyAndLoadImpulseResponseFromBlock(ir, spec.sampleRate,
                                            ir.getNumChannels() == 2,
                                            false, false, 0);
    }

You can see this code in it’s full context here: https://github.com/QVbDev/quantumVerb/blob/6801e015091c182a70e26471d3b58ee736eac2b9/Source/Convolution.cpp#L84

There’s some useful discussion here: Load impulse response from existing audio buffer for dsp::Convolution - #15 by reuk

This seems to do the trick, though it’s not exactly the answer to the original question. If anyone knows the answer to the original Q, I’m still quite curious about it. Thanks!

		// What if I just ram in the binary data?
		const IRBank& irBank = IRBank::getInstance();
		BinaryData::large_church_wav;

		loadImpulseResponse(BinaryData::large_church_wav, BinaryData::large_church_wavSize,
			(Stereo)(impulseResponse.getNumChannels() == 2),
			(Trim)false, (size_t)0, (Normalise)false);