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

◆ write() [3/4]

void MayaFlux::IO::SoundFileWriter::write ( const std::vector< Kakshya::DataVariant > &  planar)

Post planar per-channel data to the work queue.

Accepts the DataVariant vector directly from AudioOutputContainer::get_processed_data(). Interleaving is deferred to the worker thread.

Parameters
planarPer-channel vectors; each element must be vector<double>.

Definition at line 104 of file SoundFileWriter.cpp.

105{
106 if (!m_open.load(std::memory_order_acquire) || planar.empty())
107 return;
108
109 const auto& ch0 = std::get<std::vector<double>>(planar[0]);
110 auto frames = static_cast<uint32_t>(ch0.size());
111 if (frames == 0)
112 return;
113
114 PlanarChunk chunk;
115 chunk.num_frames = frames;
116 chunk.channels.reserve(planar.size());
117 for (const auto& v : planar)
118 chunk.channels.push_back(std::get<std::vector<double>>(v));
119
120 post(std::move(chunk));
121}
bool post(const WorkItem &item)

References MayaFlux::IO::SoundFileWriter::PlanarChunk::channels, m_open, MayaFlux::IO::SoundFileWriter::PlanarChunk::num_frames, and post().

+ Here is the call graph for this function: