Contents

class

SushiDSP::WavFile

Reads a subset of the RIFF/WAVE format (PCM 16/24/32-bit or 32-bit IEEE float, any channel count) sufficient for loading impulse responses.

Declared in
include/SushiDSP/io/WavFile.hpp

Not real-time safe — call only at load time, off the audio thread, exactly like PartitionedConvolution's constructor.

Static public member functions

static std::vector< float > load_mono(const std::string &path, double *out_sample_rate=nullptr)

Loads a WAV file, downmixing to mono and converting to float in [-1, 1].

Parameters

path

Filesystem path to the WAV file.

out_sample_rate

If non-null, receives the file's sample rate in Hz.

Returns

The mono sample data.

Exceptions

std::runtime_error

if the file cannot be opened or parsed.

static std::vector< std::vector< float > > load_channels(const std::string &path, double *out_sample_rate=nullptr)

Loads a WAV file, keeping its channels apart and converting to float in [-1, 1].

Parameters

path

Filesystem path to the WAV file.

out_sample_rate

If non-null, receives the file's sample rate in Hz.

Returns

One vector of samples per channel, in the file's own channel order.

Exceptions

std::runtime_error

if the file cannot be opened or parsed.