The pieces / weirdnet-audio-plugin

weirdnet-audio-pluginnew

Audio plugins: the Plugin trait, typed parameters, a registry, chain processing with a content-hash cache key, and the built-ins gain, levels, frequencies, pitch and duration.

v0.3.0 GitHub crates.io docs.rs weirdnet-audio-plugin = "0.3.0"

What it is

A plugin takes a waveform from weirdnet-media and typed parameters, and returns a new waveform. Plugins are pure, so a result can be cached under a key that means what it says. Hosting third-party plugin formats is out of scope.

Key types and modules

  • Plugin, ParamSpec, ParamValues: a plugin declares its parameters (float with a range and unit, bool, or a choice, each with a default); resolve fills defaults and rejects unknown names, wrong kinds and out-of-range values.
  • Registry holds plugins by id (with_builtins has the built-ins); apply_chain runs PluginInstances in order, and a step can be bypassed.
  • chain_cache_key: a BLAKE3 key over the source, each active step’s plugin id and version, and its resolved parameters. Spelled-out defaults and bypassed steps do not change it; its value for a fixed input is pinned by a test.
  • Built-ins, each an identity at its defaults: weirdnet.gain, weirdnet.levels, weirdnet.frequencies (filters from weirdnet-dsp), weirdnet.pitch and weirdnet.duration (stretch is the crate feature stretch, on by default, and needs clang and libclang).

Usage

[dependencies]
weirdnet-audio-plugin = "0.3.0"

Where it fits

Version 0.3.0 is on crates.io (docs.rs, repository).