MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write() [4/4]

void MayaFlux::IO::SoundFileWriter::write ( std::span< const double >  interleaved,
uint32_t  num_frames = 0 
)

Post interleaved double-precision frames to the work queue.

Parameters
interleavedInterleaved PCM frames in double precision.
num_framesFrame count (samples / channels). If 0, inferred as interleaved.size() / channels.

Definition at line 90 of file SoundFileWriter.cpp.

91{
92 if (!m_open.load(std::memory_order_acquire) || interleaved.empty())
93 return;
94
95 uint32_t frames = num_frames > 0
96 ? num_frames
97 : static_cast<uint32_t>(interleaved.size() / (m_channels > 0 ? m_channels : 1));
98
99 post(FrameChunk {
100 .samples = std::vector<double>(interleaved.begin(), interleaved.end()),
101 .num_frames = frames });
102}
bool post(const WorkItem &item)

References m_channels, m_open, post(), and MayaFlux::IO::SoundFileWriter::FrameChunk::samples.

Referenced by write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: