|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API std::shared_ptr< Kriya::SamplingPipeline > MayaFlux::create_sampler | ( | const std::string & | filepath, |
| uint32_t | num_samples = 48000 *5, |
||
| bool | truncate = true, |
||
| uint32_t | channel = 0, |
||
| uint64_t | max_dur_ms = 0 |
||
| ) |
Construct a built SamplingPipeline from an audio file.
Loads the file into a DynamicSoundStream via SoundFileReader::load_bounded, constructs a SamplingPipeline with engine globals (BufferManager, TaskScheduler, buffer size), calls build(), and returns the result.
The returned sampler is ready for play() and play_continuous() calls. Voice slots are allocated on demand via load().
| filepath | Path to the audio file (any FFmpeg-supported format). |
| num_samples | Number of samples to load from the file (default: 48000 * 5). |
| truncate | Truncate stream to num_samples if true (default: true). |
| channel | Output channel index (default: 0). |
| max_dur_ms | Optional maximum duration to build the pipeline for (in milliseconds). Defaults to 0 which is infinite (the pipeline will run until the sampler is destroyed). |
Definition at line 15 of file Rigs.cpp.
References MayaFlux::Journal::API, channel, MayaFlux::Journal::FileIO, get_buffer_manager(), MayaFlux::Config::get_buffer_size(), get_io_manager(), get_scheduler(), and MF_ERROR.
Referenced by MayaFlux::Core::BackendResourceManager::~BackendResourceManager().
Here is the call graph for this function:
Here is the caller graph for this function: