Decode a local audio file to interleaved-stereo S16 PCM, one chunk at a time.
Wraps the Rockbox codec engine. The codec state is process-wide, so only one
decoder may decode at a time — opening a second one blocks until the first is
freed. A handle is an opaque MemorySegment; every function takes it as the
first argument. Free it with free (or use with-decoder).
Decode a local audio file to interleaved-stereo S16 PCM, one chunk at a time. Wraps the Rockbox codec engine. The codec state is process-wide, so only one decoder may decode at a time — opening a second one blocks until the first is freed. A handle is an opaque MemorySegment; every function takes it as the first argument. Free it with `free` (or use `with-decoder`).
(elapsed-ms p)Playback position last reported by the codec, in milliseconds.
Playback position last reported by the codec, in milliseconds.
(finished p)[done code]: done is true once the track has ended; code is the exit
status (0 = clean end, negative = codec error), valid only when done.
`[done code]`: `done` is true once the track has ended; `code` is the exit status (0 = clean end, negative = codec error), valid only when `done`.
(free p)Free the native handle. Safe to call with nil.
Free the native handle. Safe to call with nil.
(metadata p)Tags and stream properties (same shape as rockbox.ffi.metadata/read),
as a map with keyword keys.
Tags and stream properties (same shape as `rockbox.ffi.metadata/read`), as a map with keyword keys.
(next-chunk p)Next buffer of decoded PCM as [samples sample-rate], where samples is an
interleaved stereo short-array. Returns nil at end of track (or after a codec
error — see finished).
Next buffer of decoded PCM as `[samples sample-rate]`, where `samples` is an interleaved stereo short-array. Returns nil at end of track (or after a codec error — see `finished`).
(open path)Open a streaming decoder for the audio file at path.
Open a streaming decoder for the audio file at `path`.
(seek-ms p ms)Request a seek to ms milliseconds.
Request a seek to `ms` milliseconds.
(with-decoder [sym path] & body)Bind sym to a fresh decoder for path, run body, then free it.
Bind `sym` to a fresh decoder for `path`, 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 |