Module samples

Module samples 

Source
Expand description

Sample loading and management for native builds

This module provides functionality to load sample banks from disk (TOML manifests + WAV files) and manage a registry of loaded samples for use in audio rendering.

Structs§

BankMetadata
Bank metadata for lazy loading
SampleData
Sample data (mono f32 PCM)
SampleRegistry
Sample registry for managing loaded samples with lazy loading

Functions§

auto_load_banks
Auto-discover and load banks from standard locations
get_sample
Get sample from global registry (with lazy loading)
get_stats
Get registry statistics (banks, total samples, loaded samples)
load_bank_from_directory
Load a bank from a directory containing bank.toml and audio files Uses lazy loading: only metadata is loaded initially, samples are loaded on demand
register_sample
Register a sample into the global registry with the given URI.
register_sample_from_path
Convenience: load a WAV file at path and register it under an absolute path string URI. Returns the URI used (absolute path) on success.