21 const std::string& filepath, uint32_t num_samples,
bool truncate,
22 uint32_t channel, uint64_t max_dur_ms)
28 "create_sampler: failed to load '{}'", filepath);
36 auto sampler = std::make_shared<Kriya::SamplingPipeline>(
37 std::move(
stream), mgr, sched, channel, buf_size);
40 sampler->build_for(max_dur_ms);
49 std::shared_ptr<Kakshya::DynamicSoundStream>
stream,
50 uint32_t channel, uint64_t max_dur_ms)
59 auto sampler = std::make_shared<Kriya::SamplingPipeline>(
60 std::move(
stream), mgr, sched, channel, buf_size);
63 sampler->build_for(max_dur_ms);
73 std::vector<std::shared_ptr<Kriya::SamplingPipeline>> samplers_from_stream(
74 const std::shared_ptr<Kakshya::DynamicSoundStream>&
stream,
75 uint64_t max_dur_ms, uint32_t max_channels)
77 const uint32_t ch_count = (max_channels == 0)
81 std::vector<std::shared_ptr<Kriya::SamplingPipeline>> result;
82 result.reserve(ch_count);
84 for (uint32_t i = 0; i < ch_count; ++i)
93 uint32_t num_samples,
bool truncate, uint32_t channel, uint64_t max_dur_ms)
99 "create_sampler: no file chosen");
107 const std::string& filepath, uint32_t num_samples,
bool truncate,
108 uint64_t max_dur_ms, uint32_t max_channels)
114 "create_samplers: failed to load '{}'", filepath);
118 return samplers_from_stream(
stream, max_dur_ms, max_channels);
122 uint32_t num_samples,
bool truncate, uint64_t max_dur_ms, uint32_t max_channels)
128 "create_samplers: no file chosen");
132 return samplers_from_stream(
stream, max_dur_ms, max_channels);
136 const std::string& filepath, uint32_t num_samples,
bool truncate)
142 "create_tap_set: failed to load '{}'", filepath);
154 "create_tap_set: no file chosen");
161 std::shared_ptr<Kakshya::DynamicSoundStream>
stream)
175 std::optional<Portal::Graphics::FitMode> fit)
181 builder.render(std::move(render));
188 std::optional<Portal::Graphics::FitMode> fit,
195 array->setup_rendering(render);
202 const auto capacity =
static_cast<uint64_t
>(seconds *
static_cast<double>(
rate));
204 if (capacity == 0 ||
channels == 0) {
206 "create_ring: {} seconds on {} channels is empty", seconds,
channels);
210 auto ring = std::make_shared<Kakshya::DynamicSoundStream>(
rate,
channels);
211 ring->enable_circular_buffer(capacity);
216 const std::shared_ptr<Kakshya::DynamicSoundStream>&
stream,
223 source.for_cycles(1);
228 pipeline->execute_buffer_rate();
234 const std::shared_ptr<Kakshya::DynamicSoundStream>&
stream,
235 const std::shared_ptr<Buffers::AudioBuffer>&
buffer, uint32_t channel)
245 const std::shared_ptr<Kakshya::DynamicSoundStream>&
stream,
246 std::vector<Kriya::CaptureBuilder> sources)
248 std::vector<std::shared_ptr<Kriya::BufferPipeline>> pipelines;
254 pipelines.reserve(sources.size());
255 for (
size_t channel = 0; channel < sources.size(); ++channel) {
256 pipelines.push_back(
record_into(
stream, std::move(sources[channel]),
static_cast<uint32_t
>(channel)));
264 return std::make_shared<Yantra::Vision::VisionWorkflow>(
#define MF_ERROR(comp, ctx,...)
Core::GlobalStreamInfo stream
Dialog-backed loading and file-type helpers.
std::shared_ptr< NetworkGeometryBuffer > buffer
Pre-assembled, purpose-built signal flow configurations.
void set_mode(uint32_t mode)
Set the mode number passed to the shader.
A TextureBuffer whose image is a stack of layers, composed in one draw.
static BufferOperation route_to_container(std::shared_ptr< Kakshya::DynamicSoundStream > target, uint32_t channel=0)
Create a routing operation to DynamicSoundStream destination.
static CaptureBuilder capture_from(std::shared_ptr< Buffers::AudioBuffer > buffer)
Create a CaptureBuilder for fluent capture configuration.
Fundamental unit of operation in buffer processing pipelines.
Fluent builder interface for constructing BufferCapture configurations.
Declares the layers of a Chimera, in order, and starts feeding them.
Describes a tap set one tap at a time, then starts it.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
uint32_t get_buffer_size()
Gets the buffer size from the default engine.
uint32_t get_sample_rate()
Gets the sample rate from the default engine.
@ Configuration
Configuration and parameter updates.
@ FileIO
Filesystem I/O operations.
@ API
MayaFlux/API Wrapper and convenience functions.
std::shared_ptr< Vruta::EventManager > get_event_manager()
Gets the event manager from the default engine.
Kriya::ChimeraBuilder create_chimera(std::shared_ptr< Buffers::TextureArrayBuffer > buffer)
Begin assembling the layers of a TextureArrayBuffer from what feeds each.
Kriya::TapSetBuilder create_tap_set(const std::string &filepath, uint32_t num_samples, bool truncate)
Begin describing several taps that read one audio file.
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< Yantra::Vision::VisionWorkflow > create_vision_workflow()
A vision workflow running on the engine's managers.
std::shared_ptr< Kakshya::DynamicSoundStream > create_ring(double seconds, uint32_t channels)
Make a circular stream that keeps the most recent seconds of a signal.
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< Kriya::BufferPipeline > record_into(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, Kriya::CaptureBuilder source, uint32_t channel)
Record a signal into one channel of a stream, a block at a time.
std::shared_ptr< Kriya::BufferPipeline > create_buffer_pipeline()
Creates a new buffer pipeline instance.
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< Buffers::TextureArrayBuffer > create_texture_array(const Kakshya::VideoStreamSpec &spec, const Portal::Graphics::RenderConfig &render, std::optional< Portal::Graphics::FitMode > fit, uint32_t mode)
Make a layered texture buffer that draws to a window.
std::shared_ptr< Kakshya::DynamicSoundStream > choose_audio_bounded(uint64_t max_frames, bool truncate)
Present a native open-file dialog filtered to audio formats and load the chosen file via IOManager::l...
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Kriya::TapSetBuilder create_tap_set_from_stream(std::shared_ptr< Kakshya::DynamicSoundStream > stream)
Begin describing several taps that read an existing DynamicSoundStream.
Main namespace for the Maya Flux audio engine.
uint32_t get_num_channels() const
Retrieves the number of output channels.
Describes a DynamicVideoStream so it can be built by designated initializer.
Unified rendering configuration for graphics buffers.