Skip to main content

Module dsp

Module dsp 

Source
Expand description

DSP primitives: load, effects, write.

Structs§

AudioBuffer
Mono or stereo audio buffer at a known sample rate.
BiquadState
Persistent biquad filter state — must survive across audio blocks.

Functions§

bandpass
Bandpass filter (lowpass + highpass).
biquad
Biquad filter with persistent state (for real-time block-by-block processing).
bitcrush
Bitcrush: reduce bit depth and sample rate.
compute_waveform_bands
Compute 3-band waveform energy at resolution-sample windows. Returns Vec<[low, mid, high]> with each value normalized 0.0–1.0. Bands: low <200Hz, mid 200–4000Hz, high >4000Hz.
delay
eq_3band
3-band EQ using biquad shelving/peaking filters (no phase-splitting). Low shelf at 200 Hz, mid peak at 1 kHz (Q=0.7), high shelf at 3 kHz. Audio EQ Cookbook coefficients (Robert Bristow-Johnson).
eq_3band_offline
Offline 3-band EQ (stateless — for non-realtime use like file processing).
granular
highpass
lfo_modulate
LFO amplitude modulation.
load_audio
Universal audio loader using symphonia. Supports MP3, FLAC, OGG, WAV, and AIFF.
load_wav
lowpass
notch_filter
Notch (band-reject) filter.
phase_vocoder
Phase vocoder time stretch (simplified overlap-add with windowed segments).
pitch_shift
resample
Resample an AudioBuffer to the target sample rate using linear interpolation. Good enough for playback normalization — sinc resampler comes later.
reverb
reverse
reverse_preswell
Reverse preswell: slice tail, reverse, prepend.
time_stretch
write_game_audio
Write game-ready audio: 16-bit WAV. For OGG Vorbis export, use external tools (ffmpeg) or wait for a pure-Rust Vorbis encoder.
write_wav