Expand description
§insta-fun
SVG snapshot testing for FunDSP audio nodes.
Generate visual snapshots of audio processing nodes to catch regressions and verify signal behavior.
Note: This library uses
insta::assert_binary_snapshotwhich is currently experimental.
§Usage
use insta_fun::*;
use fundsp::prelude::*;
// Simple snapshot
let node = sine_hz::<f32>(440.0);
snapshot_audio_node("sine_440", node);
// With input signal
let filter = lowpass_hz(1000.0, 1.0);
snapshot_audio_node_with_input("lowpass", filter, InputSource::impulse());
// Custom configuration
let config = SnapshotConfig::with_samples(100);
snapshot_audio_node_with_options("short_sine", sine_hz::<f32>(440.0), config);§Features
- Visualizes audio node inputs and outputs as SVG waveforms
- Supports multi-channel audio with color-coded traces
- Configurable sample count, SVG dimensions, and processing modes
- Built-in input generators (impulse, sine, custom)
- Batch or tick-by-tick processing
§Processing Modes
- Tick: Process one sample at a time (default)
- Batch: Process up to 64 samples at once for efficiency
§License
See LICENSE file for details.
Structs§
- Snapshot
Config - Configuration for snapshotting an audio node.
Enums§
- Input
Source - Input provided to the audio node
- Processing
- Processing mode for snapshotting an audio node.
Functions§
- snapshot_
audio_ node - Create an SVG snapshot of audio node outputs
- snapshot_
audio_ node_ with_ input - Create an SVG snapshot of audio node inputs and outputs
- snapshot_
audio_ node_ with_ options - Create an SVG snapshot of audio node outputs, with options
- snapshot_
audionode_ with_ input_ and_ options - Create an SVG snapshot of audio node inputs and outputs, with options