json module plus gleam/dynamic/decode — no
gleam_json dependency). The NIF links the Rust static archive
(target/release/librockbox_ffi.a); build it with make (which runs
cargo build --release -p rockbox-ffi first if needed) before gleam test.
Quick start
API
rockbox/player
Every mutating function returns the Player, so calls chain with |>. The
setters below apply the full Rockbox DSP chain live, mid-playback.
DspSettings is a typed record whose sections include equalizer, tone,
surround, channel_mode, stereo_width, compressor, dither, pitch,
crossfeed, bass_enhancement, and fatigue_reduction.
DspandPlayerare opaque NIF resources, freed by the BEAM garbage collector — no explicit close.- PCM crosses the boundary as a
BitArray.
rockbox/decoder
Decode an audio file to interleaved-stereo S16LE PCM (a BitArray), one
chunk at a time, straight through the Rockbox codec engine — no output device
needed.
Decode a file to PCM
Decoderis an opaque NIF resource, freed by the BEAM garbage collector — no explicit close.
The Gleam and Elixir bindings share the exact same
rockbox_ffi_nif.{c,erl} NIF, vendored into each project.