Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::audio::StreamingWriter Class Reference

Streaming audio writer — writes audio in chunks to a file. More...

#include <streaming_writer.hpp>

Public Member Functions

 StreamingWriter ()=default
 ~StreamingWriter ()
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 *interleaved_data, int num_frames)
 Write interleaved frames. Returns number of frames written.
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).
bool is_open () const
 Whether the writer is currently open.
uint64_t frames_written () const
 Total frames written so far.
 StreamingWriter (const StreamingWriter &)=delete
StreamingWriter & operator= (const StreamingWriter &)=delete

Detailed Description

Streaming audio writer — writes audio in chunks to a file.

Currently supports WAV format. Call open(), write_frames() N times, then close().

Constructor & Destructor Documentation

◆ StreamingWriter() [1/2]

pulp::audio::StreamingWriter::StreamingWriter ( )
default

◆ ~StreamingWriter()

pulp::audio::StreamingWriter::~StreamingWriter ( )

◆ StreamingWriter() [2/2]

pulp::audio::StreamingWriter::StreamingWriter ( const StreamingWriter & )
delete

Member Function Documentation

◆ close()

void pulp::audio::StreamingWriter::close ( )

Close the file (finalizes the WAV header with correct sizes).

◆ frames_written()

uint64_t pulp::audio::StreamingWriter::frames_written ( ) const
inline

Total frames written so far.

◆ is_open()

bool pulp::audio::StreamingWriter::is_open ( ) const
inline

Whether the writer is currently open.

◆ open()

bool pulp::audio::StreamingWriter::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.

sample_rate and num_channels must be known up front.

◆ operator=()

StreamingWriter & pulp::audio::StreamingWriter::operator= ( const StreamingWriter & )
delete

◆ write_frames() [1/2]

int pulp::audio::StreamingWriter::write_frames ( const float *const * channels,
int num_channels,
int num_frames )

Write deinterleaved channel data.

◆ write_frames() [2/2]

int pulp::audio::StreamingWriter::write_frames ( const float * interleaved_data,
int num_frames )

Write interleaved frames. Returns number of frames written.


The documentation for this class was generated from the following file: