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

◆ file_to_stream()

BufferOperation MayaFlux::Kriya::BufferOperation::file_to_stream ( const std::string &  filepath,
std::shared_ptr< Kakshya::DynamicSoundStream target_stream,
uint32_t  cycle_count = 0 
)
static

Create operation to route file data to DynamicSoundStream.

Parameters
filepathPath to audio file
target_streamTarget DynamicSoundStream
cycle_countNumber of cycles to read (0 = entire file)
Returns
BufferOperation configured for file to stream routing

Definition at line 78 of file BufferOperation.cpp.

82{
83 auto file_container = MayaFlux::load_audio_file(filepath);
84 if (!file_container) {
85 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO, std::source_location::current(),
86 "Failed to load audio file: {}", filepath);
87 }
88
89 auto temp_buffer = std::make_shared<Buffers::FileBridgeBuffer>(0, file_container);
90 temp_buffer->setup_chain_and_processor();
91
93 op.m_source_container = temp_buffer->get_capture_stream();
94 op.m_target_container = std::move(target_stream);
95 op.m_load_length = cycle_count;
96 return op;
97}
BufferOperation(OpType type, BufferCapture capture)
@ ROUTE
Route data to destination (buffer or container)
@ AsyncIO
Async I/O operations ( network, streaming)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
std::shared_ptr< MayaFlux::Kakshya::SoundFileContainer > load_audio_file(const std::string &filepath)
Loads an audio file into a SoundFileContainer with automatic format detection.
Definition Depot.cpp:18

References MayaFlux::Journal::AsyncIO, MayaFlux::Journal::Kriya, MayaFlux::load_audio_file(), m_load_length, m_source_container, m_target_container, and ROUTE.

+ Here is the call graph for this function: