#ifndef STEMSEP_WAV_WRITER_H #define STEMSEP_WAV_WRITER_H #include #include #include #include typedef struct WavWriter WavWriter; /* Takes ownership of file; on success it is closed by finish()/abort(), and on failure it is closed before this returns NULL. */ WavWriter *wav_writer_open(FILE *file, const char *path, uint32_t sample_rate, uint16_t channels, uint64_t total_frames, char *message, size_t message_size); bool wav_writer_write(WavWriter *writer, const float *interleaved, size_t frame_count, char *message, size_t message_size); /* Finalizes and frees the writer, on success and on failure. */ bool wav_writer_finish(WavWriter *writer, char *message, size_t message_size); /* Releases the writer without publishing the output. */ void wav_writer_abort(WavWriter *writer); #endif