JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

[Bug]: During startup calling LoadImpuseResponse before Convolution.prepare results in unnecessary reasmpling of the IR

Open 7sharp9 opened this issue 9 months ago • 0 comments

Detailed steps on how to reproduce the bug

Call LoadImpuseResponse so an IR is loaded either by the background queue (or when popAll is called by prepare) Call prepare on convolution.

The IR will be loaded and as prepare has not been called processSpec is set to the default value od 44100, so if you loaded IR differs to this ir will be resampled and a new angine created. Once prepare is called a new engione is created with the correct sample rate. This results in unecassary startup time due to the resampling and creation of engines. During profiling I measured 150 microseconds for the resample then 1.5ms for the creation of each engine.

The default sampleRate is set to 44100 so if your IR is different to this then this will occur.

What is the expected behaviour?

LoadImpuseResponse is not resampled unnecassarily during startup phase.

Operating systems

Windows, macOS

What versions of the operating systems?

Windows 11, macOS 15.3

Architectures

x86_64

Stacktrace

NA

Plug-in formats (if applicable)

AU, VST3, Standalone

Plug-in host applications (DAWs) (if applicable)

Any

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • [x] I agree to follow the Code of Conduct

7sharp9 avatar Feb 05 '25 14:02 7sharp9