macro_rules! assert_audio_node_snapshot {
($node:expr) => { ... };
($name:expr, $node:expr) => { ... };
($name:expr, $node:expr, $input:expr) => { ... };
($name:expr, $node:expr, $input:expr, $config:expr) => { ... };
}Expand description
Macro for audio node snapshot testing
This macro processes an audio node with the given configuration, generates an SVG visualization, and asserts it against a stored snapshot.
ยงExamples
use fundsp::prelude::*;
use insta_fun::{assert_audio_node_snapshot, SnapshotConfig, InputSource};
// With a custom name
let node = saw_hz(220.0);
assert_audio_node_snapshot!("doc_sawtooth", node);
// With input source
let node = lowpass_hz(1000.0, 1.0);
assert_audio_node_snapshot!("doc_lowpass", node, InputSource::impulse());
// With input source and custom config
let config = SnapshotConfig::with_samples(512);
let node = highpass_hz(2000.0, 0.7);
assert_audio_node_snapshot!("doc_highpass", node, InputSource::sine(100.0, 44100.0), config);