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

◆ read_from_container()

Kakshya::DataVariant MayaFlux::Kriya::BufferPipeline::read_from_container ( const std::shared_ptr< Kakshya::DynamicSoundStream > &  container,
uint64_t  start,
uint32_t  length 
)
staticprivate

Definition at line 263 of file BufferPipeline.cpp.

266{
267 try {
268 uint32_t read_length = length;
269 if (read_length == 0) {
270 read_length = static_cast<uint32_t>(container->get_total_elements() / container->get_num_channels());
271 }
272
273 std::vector<double> output_data(static_cast<size_t>(read_length * container->get_num_channels()));
274 std::span<double> output_span(output_data.data(), output_data.size());
275
276 uint64_t frames_read = container->read_frames(output_span, read_length);
277
278 if (frames_read < output_data.size()) {
279 output_data.resize(frames_read);
280 }
281
282 return output_data;
283
284 } catch (const std::exception& e) {
287 std::source_location::current(),
288 "Error reading from container: {}",
289 e.what());
290
291 return std::vector<double> {};
292 }
293}
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.

References MayaFlux::Journal::CoroutineScheduling, and MayaFlux::Journal::Kriya.

Referenced by process_operation().

+ Here is the caller graph for this function: