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

◆ read_from_container() [1/2]

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

Definition at line 72 of file PipelineBufferData.cpp.

75{
76 try {
77 uint32_t read_length = length;
78 if (read_length == 0) {
79 read_length = static_cast<uint32_t>(container->get_total_elements() / container->get_num_channels());
80 }
81
82 std::vector<double> output_data(static_cast<size_t>(read_length * container->get_num_channels()));
83 std::span<double> output_span(output_data.data(), output_data.size());
84
85 uint64_t frames_read = container->read_frames(output_span, read_length);
86
87 if (frames_read < output_data.size()) {
88 output_data.resize(frames_read);
89 }
90
91 return output_data;
92
93 } catch (const std::exception& e) {
94 error_rethrow(Journal::Component::Kriya,
95 Journal::Context::CoroutineScheduling,
96 std::source_location::current(),
97 "Error reading from container: {}",
98 e.what());
99
100 return std::vector<double> {};
101 }
102}
uint64_t length
Definition Composite.cpp:11

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

Referenced by MayaFlux::Kriya::BufferPipeline::process_fuse(), and MayaFlux::Kriya::BufferPipeline::process_load().

+ Here is the caller graph for this function: