25 bool open(std::string_view path, uint32_t sample_rate, uint32_t num_channels,
26 uint32_t bits_per_sample = 16);
32 int write_frames(
const float*
const* channels,
int num_channels,
int num_frames);
38 bool is_open()
const {
return file_.is_open(); }
49 uint32_t sample_rate_ = 0;
50 uint32_t num_channels_ = 0;
51 uint32_t bits_per_sample_ = 16;
52 uint64_t frames_written_ = 0;
53 size_t data_start_pos_ = 0;
uint64_t frames_written() const
Total frames written so far.
Definition streaming_writer.hpp:41
bool is_open() const
Whether the writer is currently open.
Definition streaming_writer.hpp:38
bool open(std::string_view path, uint32_t sample_rate, uint32_t num_channels, uint32_t bits_per_sample=16)
Open a file for streaming write.
int write_frames(const float *const *channels, int num_channels, int num_frames)
Write deinterleaved channel data.
void close()
Close the file (finalizes the WAV header with correct sizes).
int write_frames(const float *interleaved_data, int num_frames)
Write interleaved frames. Returns number of frames written.
StreamingWriter(const StreamingWriter &)=delete
StreamingWriter()=default
StreamingWriter & operator=(const StreamingWriter &)=delete
Definition analyzer_provider.hpp:12