16 const std::string& filepath, uint32_t num_samples,
bool truncate,
17 uint32_t
channel, uint64_t max_dur_ms)
19 auto stream =
get_io_manager()->load_audio_bounded(filepath, num_samples, truncate);
23 "create_sampler: failed to load '{}'", filepath);
31 auto sampler = std::make_shared<Kriya::SamplingPipeline>(
32 std::move(stream), mgr, sched,
channel, buf_size);
35 sampler->build_for(max_dur_ms);
44 std::shared_ptr<Kakshya::DynamicSoundStream> stream,
45 uint32_t
channel, uint64_t max_dur_ms)
54 auto sampler = std::make_shared<Kriya::SamplingPipeline>(
55 std::move(stream), mgr, sched,
channel, buf_size);
58 sampler->build_for(max_dur_ms);
67 const std::string& filepath, uint32_t num_samples,
bool truncate,
68 uint64_t max_dur_ms, uint32_t max_channels)
70 auto stream =
get_io_manager()->load_audio_bounded(filepath, num_samples, truncate);
74 "create_samplers: failed to load '{}'", filepath);
78 const uint32_t ch_count = (max_channels == 0)
79 ? stream->get_num_channels()
80 : std::min(max_channels, stream->get_num_channels());
82 std::vector<std::shared_ptr<Kriya::SamplingPipeline>> result;
83 result.reserve(ch_count);
85 for (uint32_t i = 0; i < ch_count; ++i)
#define MF_ERROR(comp, ctx,...)
Audio file loading and container management API.
Pre-assembled, purpose-built signal flow configurations.
uint32_t get_buffer_size()
Gets the buffer size from the default engine.
@ FileIO
Filesystem I/O operations.
@ API
MayaFlux/API Wrapper and convenience functions.
std::shared_ptr< Kriya::SamplingPipeline > create_sampler(const std::string &filepath, uint32_t num_samples, bool truncate, uint32_t channel, uint64_t max_dur_ms)
Construct a built SamplingPipeline from an audio file.
std::shared_ptr< Kriya::SamplingPipeline > create_sampler_from_stream(std::shared_ptr< Kakshya::DynamicSoundStream > stream, uint32_t channel, uint64_t max_dur_ms)
Construct a built SamplingPipeline from an existing DynamicSoundStream.
std::vector< std::shared_ptr< Kriya::SamplingPipeline > > create_samplers(const std::string &filepath, uint32_t num_samples, bool truncate, uint64_t max_dur_ms, uint32_t max_channels)
Construct one built SamplingPipeline per channel from an audio file.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Main namespace for the Maya Flux audio engine.