class
SushiDSP::WavWriter
Streaming WAV output: open, append frames, close.
- Declared in
include/SushiDSP/io/WavWriter.hpp
Not real-time safe — it allocates, throws and touches the filesystem, exactly like PartitionedConvolution's constructor and WavFile; call only from the control thread.
Public types
enum class FormatSample encoding written to the file.
Pcm16Float32
Public member functions
WavWriter(const std::string &path, double sample_rate, std::uint32_t channels, Format format)Opens the file and writes a placeholder header.
Parameters
pathFilesystem path to create or overwrite.
sample_rateThe file's sample rate in Hz.
channelsNumber of interleaved channels.
formatSample encoding to write.
Exceptions
std::runtime_errorif the path cannot be opened for writing.
~WavWriter()Closes the file if the caller did not already call close().
WavWriter(const WavWriter &)=deleteWavWriter & operator=(const WavWriter &)=deletevoid append(const float *const *channels, std::uint32_t frames)Appends frames, interleaving the channels.
Does nothing once close() has run.
Parameters
channelsOne pointer per channel, each with at least
framessamples.framesNumber of frames to append, per channel.
void close()Rewrites the RIFF and data sizes and closes the file. Safe to call twice.
std::uint64_t frames_written() constReturns the number of frames appended so far.

