Contents

class

SushiDSP::IrLoader

Loads cabinet impulse responses and conditions them for convolution.

Declared in
include/SushiDSP/io/IrLoader.hpp

Resamples to the host rate, truncates to a bounded length with a raised-cosine fade-out, and normalises the mid-band average magnitude to 0 dB so swapping IRs does not change perceived loudness. Control-thread only: allocates, throws, and touches the filesystem.

Static public member functions

static Ir load(const std::string &path, double target_sample_rate, const IrLoadOptions &options={})

Loads an impulse response from a WAV file and conditions it.

Parameters

path

Filesystem path to the WAV file.

target_sample_rate

Sample rate the impulse response is needed at, in Hz.

options

Conditioning options.

Returns

The conditioned impulse response at target_sample_rate.

Exceptions

std::runtime_error

if the file cannot be opened or parsed.

static Ir prepare(std::vector< float > samples, double source_rate, double target_sample_rate, const IrLoadOptions &options={})

Conditions in-memory samples through the same pipeline load() uses.

Parameters

samples

Source impulse response samples.

source_rate

Sample rate the samples were captured at, in Hz.

target_sample_rate

Sample rate the impulse response is needed at, in Hz.

options

Conditioning options.

Returns

The conditioned impulse response at target_sample_rate.

Exceptions

std::invalid_argument

if either sample rate is not positive.