The DSP pipeline: EQ, tone, surround, compressor, ReplayGain, resampler.
The underlying dsp_config is a process-wide singleton, so only one DSP handle
may exist at a time and it must be used from one thread. A handle is an opaque
MemorySegment; every function takes it as the first argument. Free it with
free (or use with-dsp).
The DSP pipeline: EQ, tone, surround, compressor, ReplayGain, resampler. The underlying dsp_config is a process-wide singleton, so only one DSP handle may exist at a time and it must be used from one thread. A handle is an opaque MemorySegment; every function takes it as the first argument. Free it with `free` (or use `with-dsp`).
(free p)Free the native handle. Safe to call with nil.
Free the native handle. Safe to call with nil.
(new-dsp sample-rate)Create a DSP pipeline for the given input sample rate (Hz).
Create a DSP pipeline for the given input sample rate (Hz).
(process p samples)Run interleaved stereo S16 samples (a short-array) through the pipeline.
Returns a new short-array (length may differ — the resampler buffers).
Run interleaved stereo S16 `samples` (a short-array) through the pipeline. Returns a new short-array (length may differ — the resampler buffers).
(set-eq-band p band cutoff-hz q gain-db)Configure one EQ band (0..9). Band 0 is a low shelf, 9 a high shelf.
Configure one EQ band (0..9). Band 0 is a low shelf, 9 a high shelf.
(set-replaygain p mode noclip? preamp-db)mode: rockbox.ffi.enums/dsp-replaygain-mode (:track :album :shuffle :off).
`mode`: rockbox.ffi.enums/dsp-replaygain-mode (:track :album :shuffle :off).
(set-replaygain-gains p
&
{:keys [track-gain-db album-gain-db track-peak album-peak]
:or {track-gain-db Float/NaN
album-gain-db Float/NaN
track-peak Float/NaN
album-peak Float/NaN}})Per-track gains in plain dB / peaks as linear amplitude (1.0 = full scale). Omit any absent tag — it defaults to the ABI's NaN sentinel.
Per-track gains in plain dB / peaks as linear amplitude (1.0 = full scale). Omit any absent tag — it defaults to the ABI's NaN sentinel.
(set-replaygain-gains-raw p track-gain album-gain track-peak album-peak)Native Q7.24 linear factors (the raw_* fields from metadata), 0 = untagged.
Native Q7.24 linear factors (the raw_* fields from metadata), 0 = untagged.
(sine-stereo freq-hz seconds rate)(sine-stereo freq-hz seconds rate amplitude)Generate seconds of a sine as an interleaved stereo short-array.
Generate `seconds` of a sine as an interleaved stereo short-array.
(with-dsp [sym sample-rate] & body)Bind sym to a fresh DSP handle for sample-rate, run body, then free it.
Bind `sym` to a fresh DSP handle for `sample-rate`, run `body`, then free it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |