MayaFlux 0.4.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 276 of file BufferPipeline.cpp.

279{
280 try {
281 uint32_t read_length = length;
282 if (read_length == 0) {
283 read_length = static_cast<uint32_t>(container->get_total_elements() / container->get_num_channels());
284 }
285
286 std::vector<double> output_data(static_cast<size_t>(read_length * container->get_num_channels()));
287 std::span<double> output_span(output_data.data(), output_data.size());
288
289 uint64_t frames_read = container->read_frames(output_span, read_length);
290
291 if (frames_read < output_data.size()) {
292 output_data.resize(frames_read);
293 }
294
295 return output_data;
296
297 } catch (const std::exception& e) {
300 std::source_location::current(),
301 "Error reading from container: {}",
302 e.what());
303
304 return std::vector<double> {};
305 }
306}
@ 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: