Juce dsp::convolution kills audio sometimes?



I have a basic IR-loader code that sometimes (not always) goes completely silent. The weird thing is, it also mutes the original buffer which is not convoluted at all, resulting in completely muted plugin. When this happens, no errors for the debugger. Actually, I haven’t faced this problem at all with debugging turned on. I also tried without optimization for release build, still happens. This problem happens when method is run that loads a new IR for the convolution filter. Any known situations when this might occur? Here’s the IR loader code:

void VerbAudioProcessor::loadIR(int ID)
	int FileSize;
	const char* FileN = BinaryData::getNamedResource(BinaryData::namedResourceList[IRList[ID]->ID], FileSize);
	IRFilter.loadImpulseResponse(FileN, FileSize, StereoMode->get(), false, FileSize);

PrepareToPlay -method:

void VerbAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
    // Use this method as the place to do any pre-playback
    // initialisation that you need..
	dsp::ProcessSpec spec;
	spec.sampleRate = sampleRate;
	spec.maximumBlockSize = samplesPerBlock;
	spec.numChannels = getTotalNumOutputChannels();


ProcessBlock’s part where processing happens:

tempBuffer = buffer;
dsp::AudioBlock<float> block(tempBuffer);

buffer.addFrom(0, 0, tempBuffer, 0, 0, SampleCount, 1.0f);
buffer.addFrom(1, 0, tempBuffer, 1, 0, SampleCount, 1.0f);


I found similar issues on the forum, and I updated JUCE to the latest version… Will check again, it’s probably solved… :slight_smile:

Edit: Latest development branch seems to work miracles, at least for now haven’t found any issues! Works with full optimizations etc. :slight_smile: