The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.
%% rebar.config{deps, [rockbox_ffi_nif]}.
rockbox_ffi_nif is the common native layer for every binding that runs on
the BEAM. The Elixir (rockbox_ex_ffi) and
Gleam (rockbox_ffi) packages both depend on it instead of
vendoring their own copy of the C shim and loader — the ergonomic wrappers live
in those packages.Requires OTP 27+ (JSON is decoded with the built-in json module). The Hex
package ships only a checksum manifest; the loader’s -on_load hook downloads
the matching prebuilt .so for your platform on first use (see
NIF delivery).
This page documents the raw NIF surface. For application code prefer the
Elixir or Gleam wrappers — they add
named enums, pipe-friendly setters, and typed return values on top of the same
native functions.
Every function is a raw NIF: strings and paths are UTF-8 binaries, *_json
functions return raw JSON binaries (decode with OTP 27’s json module), and
handles (RbDecoder, RbPlayer, RbDsp) are opaque reference()s freed by
the GC — there is no explicit close.
Read metadata
%% Guess the codec from the extension (no I/O)…<<"FLAC">> = rockbox_ffi_nif:meta_probe(<<"song.flac">>),%% …or parse the full tag / stream properties.Json = rockbox_ffi_nif:meta_read_json(<<"/music/song.flac">>),#{<<"title">> := Title, <<"artist">> := Artist, <<"duration_ms">> := DurMs, <<"sample_rate">> := Rate} = json:decode(Json).
Decode a file to PCM
decoder_next_chunk/1 hands back interleaved-stereo little-endian int16 PCM
until it returns nil at end of track.
D = rockbox_ffi_nif:decoder_open(<<"/music/song.mp3">>),%% Metadata is available straight from the open decoder.Meta = json:decode(rockbox_ffi_nif:decoder_metadata_json(D)),%% Pull every chunk into one PCM binary.Drain = fun Drain(Acc) -> case rockbox_ffi_nif:decoder_next_chunk(D) of nil -> lists:reverse(Acc); {Pcm, _Rate} -> Drain([Pcm | Acc]) endend,Pcm = iolist_to_binary(Drain([])),%% Confirm the track ended cleanly (0 = clean, negative = codec error).{true, 0} = rockbox_ffi_nif:decoder_finished(D).
Seek before decoding more:
rockbox_ffi_nif:decoder_seek_ms(D, 30000), %% jump to 30sMs = rockbox_ffi_nif:decoder_elapsed_ms(D).
The codec state is process-wide — only one RbDecoder can decode at a
time. decoder_open/1 blocks until any previous decoder is freed by the GC.
Run PCM through the DSP pipeline
Dsp = rockbox_ffi_nif:dsp_new(44100),%% Turn on the equalizer and lift a 1 kHz band by 6 dB.rockbox_ffi_nif:dsp_eq_enable(Dsp, true),rockbox_ffi_nif:dsp_set_eq_band(Dsp, 4, 1000, 1.0, 6.0),Out = rockbox_ffi_nif:dsp_process(Dsp, Pcm).
Play a queue
A player owns a live audio device and a background engine thread; dropping the
last reference to the handle stops playback.
P = rockbox_ffi_nif:player_new(),%% Queue local files and/or http(s) / stream URLs.Queue = json:encode([<<"/music/a.mp3">>, <<"/music/b.flac">>]),rockbox_ffi_nif:player_set_queue_json(P, Queue),rockbox_ffi_nif:player_enqueue(P, <<"http://host/stream.mp3">>),rockbox_ffi_nif:player_set_volume(P, 0.8),rockbox_ffi_nif:player_set_balance(P, 0), %% -100 left … +100 right, 0 = centrerockbox_ffi_nif:player_play(P),%% Transport controls.rockbox_ffi_nif:player_next(P),rockbox_ffi_nif:player_seek_ms(P, 15000),%% Poll playback state.Status = json:decode(rockbox_ffi_nif:player_status_json(P)),rockbox_ffi_nif:player_pause(P).
The player exposes the same DSP chain as the standalone pipeline —
player_set_eq_band/5, player_set_tone/5, player_set_crossfade/7,
player_set_replaygain/4, player_set_balance/2 / player_balance/1, and more
(see the module docs).
The DSP and player use different ReplayGain mode integers:
dsp_set_replaygain/4 → 0 track, 1 album, 2 shuffle, 3 off;
player_set_replaygain/4 → 0 off, 1 track, 2 album. See
the overview.
NIF delivery
The compiled NIF statically links the Rust librockbox_ffi.a, making it a
multi-megabyte shared object — too large to bundle in a Hex tarball. So the Hex
package ships only the checksum manifest, and rockbox_ffi_nif.erl’s -on_load
hook downloads the matching rockbox_ffi_nif-<triple>.so from the named GitHub
release into the user cache on first use, verifying it against the manifest
sha256. Both the Elixir and Gleam bindings get their native code the same way.Prebuilt targets: aarch64-apple-darwin, x86_64-apple-darwin,
aarch64-linux-gnu, x86_64-linux-gnu, x86_64-unknown-freebsd,
x86_64-unknown-netbsd. Other platforms build from source.
Local development
Inside a full monorepo checkout (needs the Cargo workspace + include/ header):
# 1. Build the Rust static archive.cargo build --release -p rockbox-ffi# 2. Build the NIF into priv/rockbox_ffi_nif.so.cd bindings/erlang && make# 3. Compile the Erlang app.rebar3 compile
The Elixir / Gleam bindings pick up this locally-built .so via a path
dependency on ../erlang — the loader prefers a local priv/*.so over any
cached download.
Docs
Read the published module docs at
hexdocs.pm/rockbox_ffi_nif, or generate
them locally with rebar3 ex_doc.
⌘I
{"docsConfig":{"theme":"linden","$schema":"https://mintlify.com/docs.json","name":"Rockbox Daemon","colors":{"primary":"#FF6B00","light":"#FF9347","dark":"#CC5500"},"logo":{"light":"https://mintcdn.com/rockboxzig/9kP-H_jRBkIO2KOF/logo/light.svg?fit=max\u0026auto=format\u0026n=9kP-H_jRBkIO2KOF\u0026q=85\u0026s=aef84576565438310e1b68d08aea8441","dark":"https://mintcdn.com/rockboxzig/9kP-H_jRBkIO2KOF/logo/dark.svg?fit=max\u0026auto=format\u0026n=9kP-H_jRBkIO2KOF\u0026q=85\u0026s=1de817c23b895c5f3c8ee6038b765263"},"favicon":"https://mintcdn.com/rockboxzig/9kP-H_jRBkIO2KOF/favicon.svg?fit=max\u0026auto=format\u0026n=9kP-H_jRBkIO2KOF\u0026q=85\u0026s=dd84886ca336d7a88e8e0aff96cad6b8","appearance":{"default":"dark","strict":true},"background":{"decoration":"grid","color":{"light":"#fffbf7","dark":"#07080C"}},"navbar":{"links":[{"href":"https://github.com/tsirysndr/rockboxd/issues","label":"Issues"}],"primary":{"type":"github","href":"https://github.com/tsirysndr/rockboxd"}},"footer":{"socials":{"github":"https://github.com/tsirysndr/rockboxd","discord":"https://discord.gg/tXPrgcPKSt"}},"styling":{"codeblocks":{"theme":{"light":"catppuccin-latte","dark":"min-dark"}},"latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/tsirysndr/rockboxd"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/tXPrgcPKSt"},{"anchor":"Releases","icon":"rocket","href":"https://github.com/tsirysndr/rockboxd/releases"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rockboxzig","hasAudioNarration":false,"actualSubdomain":"rockboxzig","customDomains":[],"gitSource":{"type":"github","owner":"tsirysndr","repo":"rockboxd","deployBranch":"master","contentDirectory":"mintlify","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae0cb56c9d0adb3afbd704f","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"API reference","count":82},{"language":"default","tag":"HTTP REST","count":75},{"language":"default","tag":"Guides","count":30},{"language":"default","tag":"Player","count":16},{"language":"default","tag":"Saved playlists","count":13},{"language":"default","tag":"Bindings","count":11},{"language":"default","tag":"Native engine bindings","count":11},{"language":"default","tag":"Playlist (queue)","count":10},{"language":"default","tag":"Audio output","count":8},{"language":"default","tag":"Overview","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"bindings/erlang","slug":"/bindings/erlang","pageMetadata":{"title":"Erlang","description":"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.","icon":"layer-group","href":"/bindings/erlang"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% rebar.config`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`{`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`deps`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` [`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`]}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`rockbox_ffi_nif`}),` is the `,_jsx(_components.strong,{children:`common native layer`}),` for every binding that runs on\nthe BEAM. The `,_jsx(_components.a,{href:`/bindings/elixir`,children:`Elixir`}),` (`,_jsx(_components.code,{children:`rockbox_ex_ffi`}),`) and\n`,_jsx(_components.a,{href:`/bindings/gleam`,children:`Gleam`}),` (`,_jsx(_components.code,{children:`rockbox_ffi`}),`) packages both depend on it instead of\nvendoring their own copy of the C shim and loader — the ergonomic wrappers live\nin those packages.`]}),`\n`,_jsxs(_components.p,{children:[`Requires `,_jsx(_components.strong,{children:`OTP 27+`}),` (JSON is decoded with the built-in `,_jsx(_components.code,{children:`json`}),` module). The Hex\npackage ships only a checksum manifest; the loader’s `,_jsx(_components.code,{children:`-on_load`}),` hook downloads\nthe matching prebuilt `,_jsx(_components.code,{children:`.so`}),` for your platform on first use (see\n`,_jsx(_components.a,{href:`#nif-delivery`,children:`NIF delivery`}),`).`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This page documents the `,_jsx(_components.strong,{children:`raw NIF surface`}),`. For application code prefer the\n`,_jsx(_components.a,{href:`/bindings/elixir`,children:`Elixir`}),` or `,_jsx(_components.a,{href:`/bindings/gleam`,children:`Gleam`}),` wrappers — they add\nnamed enums, pipe-friendly setters, and typed return values on top of the same\nnative functions.`]})}),`\n`,_jsxs(_components.p,{children:[`Every function is a raw NIF: strings and paths are `,_jsx(_components.strong,{children:`UTF-8 binaries`}),`, `,_jsx(_components.code,{children:`*_json`}),`\nfunctions return raw JSON binaries (decode with OTP 27’s `,_jsx(_components.code,{children:`json`}),` module), and\nhandles (`,_jsx(_components.code,{children:`RbDecoder`}),`, `,_jsx(_components.code,{children:`RbPlayer`}),`, `,_jsx(_components.code,{children:`RbDsp`}),`) are opaque `,_jsx(_components.code,{children:`reference()`}),`s freed by\nthe GC — there is no explicit close.`]}),`\n`,_jsx(Heading,{level:`2`,id:`read-metadata`,children:`Read metadata`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Guess the codec from the extension (no I/O)…`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"FLAC\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`meta_probe`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"song.flac\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% …or parse the full tag / stream properties.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Json `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`meta_read_json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"/music/song.flac\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`#`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`{\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"title\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` :`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Title`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"artist\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` :`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Artist`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"duration_ms\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` :`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` DurMs`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"sample_rate\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` :`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Rate`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`}`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decode`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`decode-a-file-to-pcm`,children:`Decode a file to PCM`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`decoder_next_chunk/1`}),` hands back interleaved-stereo little-endian `,_jsx(_components.code,{children:`int16`}),` PCM\nuntil it returns `,_jsx(_components.code,{children:`nil`}),` at end of track.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_open`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"/music/song.mp3\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Metadata is available straight from the open decoder.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Meta `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decode`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_metadata_json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`))`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Pull every chunk into one PCM binary.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Drain `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#F97583`},children:` fun`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Drain`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Acc`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:` ->`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#F97583`},children:` case`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_next_chunk`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#F97583`},children:` of`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` nil `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`->`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` lists`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`reverse`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Acc`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Pcm`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` _Rate`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`}`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:` ->`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Drain`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`([`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Pcm `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`|`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Acc`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`])`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#F97583`},children:` end`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#F97583`},children:`end`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Pcm `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` iolist_to_binary`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Drain`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`([]))`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Confirm the track ended cleanly (0 = clean, negative = codec error).`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`{`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-dark\":`#79B8FF`},children:`true`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`}`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_finished`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Seek before decoding more:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_seek_ms`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 30000`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`, `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% jump to 30s`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Ms `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decoder_elapsed_ms`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`D`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The codec state is `,_jsx(_components.strong,{children:`process-wide`}),` — only one `,_jsx(_components.code,{children:`RbDecoder`}),` can decode at a\ntime. `,_jsx(_components.code,{children:`decoder_open/1`}),` blocks until any previous decoder is freed by the GC.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`run-pcm-through-the-dsp-pipeline`,children:`Run PCM through the DSP pipeline`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Dsp `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`dsp_new`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:`44100`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Turn on the equalizer and lift a 1 kHz band by 6 dB.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`dsp_eq_enable`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Dsp`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-dark\":`#79B8FF`},children:` true`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`dsp_set_eq_band`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Dsp`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 4`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 1000`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 1`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`.`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:`0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 6`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`.`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:`0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Out `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`dsp_process`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Dsp`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Pcm`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`play-a-queue`,children:`Play a queue`}),`\n`,_jsx(_components.p,{children:`A player owns a live audio device and a background engine thread; dropping the\nlast reference to the handle stops playback.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`erlang`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`erlang`,children:_jsxs(_components.code,{language:`erlang`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_new`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`()`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Queue local files and/or http(s) / stream URLs.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Queue `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`encode`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`([\u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"/music/a.mp3\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"/music/b.flac\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>])`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_set_queue_json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:` Queue`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_enqueue`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#FFAB70`},children:`\"http://host/stream.mp3\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`>>)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_set_volume`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`.`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:`8`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_set_balance`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`, `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% -100 left … +100 right, 0 = centre`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_play`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Transport controls.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_next`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_seek_ms`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`,`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#F8F8F8`},children:` 15000`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`%% Poll playback state.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`Status `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`decode`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_status_json`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`))`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rockbox_ffi_nif`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:`:`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`player_pause`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`(`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`P`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#B392F0`},children:`)`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#B392F0`},children:`.`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The player exposes the same DSP chain as the standalone pipeline —\n`,_jsx(_components.code,{children:`player_set_eq_band/5`}),`, `,_jsx(_components.code,{children:`player_set_tone/5`}),`, `,_jsx(_components.code,{children:`player_set_crossfade/7`}),`,\n`,_jsx(_components.code,{children:`player_set_replaygain/4`}),`, `,_jsx(_components.code,{children:`player_set_balance/2`}),` / `,_jsx(_components.code,{children:`player_balance/1`}),`, and more\n(see the `,_jsx(_components.a,{href:`https://hexdocs.pm/rockbox_ffi_nif/`,children:`module docs`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`api`,children:`API`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Surface`}),_jsx(_components.th,{children:`Functions`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Metadata`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`meta_probe/1`}),`, `,_jsx(_components.code,{children:`meta_read_json/1`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RbDecoder`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`decoder_open/1`}),`, `,_jsx(_components.code,{children:`decoder_metadata_json/1`}),`, `,_jsx(_components.code,{children:`decoder_next_chunk/1`}),`, `,_jsx(_components.code,{children:`decoder_seek_ms/2`}),`, `,_jsx(_components.code,{children:`decoder_elapsed_ms/1`}),`, `,_jsx(_components.code,{children:`decoder_finished/1`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RbDsp`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`dsp_new/1`}),`, `,_jsx(_components.code,{children:`dsp_eq_enable/2`}),`, `,_jsx(_components.code,{children:`dsp_set_eq_band/5`}),`, `,_jsx(_components.code,{children:`dsp_process/2`}),`, ReplayGain / tone / surround / compressor setters`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RbPlayer`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`player_new/0`}),`, queue + transport, `,_jsx(_components.code,{children:`player_set_volume/2`}),`, `,_jsx(_components.code,{children:`player_set_balance/2`}),` / `,_jsx(_components.code,{children:`player_balance/1`}),`, crossfade, ReplayGain, full DSP chain, `,_jsx(_components.code,{children:`player_status_json/1`})]})]})]})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Handles (`,_jsx(_components.code,{children:`RbDecoder`}),`, `,_jsx(_components.code,{children:`RbDsp`}),`, `,_jsx(_components.code,{children:`RbPlayer`}),`) are NIF resources freed by the BEAM\ngarbage collector — no explicit close.`]}),`\n`,_jsxs(_components.li,{children:[`PCM crosses the boundary as an `,_jsx(_components.strong,{children:`int16 LE binary`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Rich values (`,_jsx(_components.code,{children:`*_json`}),`) come back as raw JSON binaries — decode with OTP 27’s\nbuilt-in `,_jsx(_components.code,{children:`json`}),` module.`]}),`\n`,_jsxs(_components.li,{children:[`The DSP chain mirrors Rockbox’s own; see the\n`,_jsx(_components.a,{href:`https://download.rockbox.org/daily/manual/rockbox-ipodvideo/rockbox-buildch6.html`,children:`official Rockbox sound-settings manual`}),`\nfor what each control does.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The DSP and player use `,_jsx(_components.strong,{children:`different ReplayGain mode integers`}),`:\n`,_jsx(_components.code,{children:`dsp_set_replaygain/4`}),` → `,_jsx(_components.code,{children:`0`}),` track, `,_jsx(_components.code,{children:`1`}),` album, `,_jsx(_components.code,{children:`2`}),` shuffle, `,_jsx(_components.code,{children:`3`}),` off;\n`,_jsx(_components.code,{children:`player_set_replaygain/4`}),` → `,_jsx(_components.code,{children:`0`}),` off, `,_jsx(_components.code,{children:`1`}),` track, `,_jsx(_components.code,{children:`2`}),` album. See\n`,_jsx(_components.a,{href:`/bindings/overview#the-one-thing-to-know-two-replaygain-encodings`,children:`the overview`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`nif-delivery`,children:`NIF delivery`}),`\n`,_jsxs(_components.p,{children:[`The compiled NIF statically links the Rust `,_jsx(_components.code,{children:`librockbox_ffi.a`}),`, making it a\nmulti-megabyte shared object — too large to bundle in a Hex tarball. So the Hex\npackage ships only the checksum manifest, and `,_jsx(_components.code,{children:`rockbox_ffi_nif.erl`}),`’s `,_jsx(_components.code,{children:`-on_load`}),`\nhook downloads the matching `,_jsx(_components.code,{children:`rockbox_ffi_nif-\u003ctriple>.so`}),` from the named GitHub\nrelease into the user cache on first use, verifying it against the manifest\nsha256. Both the Elixir and Gleam bindings get their native code the same way.`]}),`\n`,_jsxs(_components.p,{children:[`Prebuilt targets: `,_jsx(_components.code,{children:`aarch64-apple-darwin`}),`, `,_jsx(_components.code,{children:`x86_64-apple-darwin`}),`,\n`,_jsx(_components.code,{children:`aarch64-linux-gnu`}),`, `,_jsx(_components.code,{children:`x86_64-linux-gnu`}),`, `,_jsx(_components.code,{children:`x86_64-unknown-freebsd`}),`,\n`,_jsx(_components.code,{children:`x86_64-unknown-netbsd`}),`. Other platforms build from source.`]}),`\n`,_jsx(Heading,{level:`2`,id:`local-development`,children:`Local development`}),`\n`,_jsxs(_components.p,{children:[`Inside a full monorepo checkout (needs the Cargo workspace + `,_jsx(_components.code,{children:`include/`}),` header):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte min-dark`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#4c4f69`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`# 1. Build the Rust static archive.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`cargo`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` build`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` --release`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` -p`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` rockbox-ffi`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`# 2. Build the NIF into priv/rockbox_ffi_nif.so.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`cd`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` bindings/erlang`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#BBBBBB`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:` make`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#6B737C`,\"--shiki-dark-font-style\":`inherit`},children:`# 3. Compile the Erlang app.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#B392F0`,\"--shiki-dark-font-style\":`inherit`},children:`rebar3`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#9DB1C5`},children:` compile`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The Elixir / Gleam bindings pick up this locally-built `,_jsx(_components.code,{children:`.so`}),` via a path\ndependency on `,_jsx(_components.code,{children:`../erlang`}),` — the loader prefers a local `,_jsx(_components.code,{children:`priv/*.so`}),` over any\ncached download.`]}),`\n`,_jsx(Heading,{level:`2`,id:`docs`,children:`Docs`}),`\n`,_jsxs(_components.p,{children:[`Read the published module docs at\n`,_jsx(_components.a,{href:`https://hexdocs.pm/rockbox_ffi_nif/`,children:`hexdocs.pm/rockbox_ffi_nif`}),`, or generate\nthem locally with `,_jsx(_components.code,{children:`rebar3 ex_doc`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"catppuccin-latte","dark":"min-dark"}},"config":{},"pageMetadata":{"title":"Erlang","description":"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.","icon":"layer-group","href":"/bindings/erlang"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Read metadata","slug":"read-metadata","depth":2,"children":[]},{"title":"Decode a file to PCM","slug":"decode-a-file-to-pcm","depth":2,"children":[]},{"title":"Run PCM through the DSP pipeline","slug":"run-pcm-through-the-dsp-pipeline","depth":2,"children":[]},{"title":"Play a queue","slug":"play-a-queue","depth":2,"children":[]},{"title":"API","slug":"api","depth":2,"children":[]},{"title":"NIF delivery","slug":"nif-delivery","depth":2,"children":[]},{"title":"Local development","slug":"local-development","depth":2,"children":[]},{"title":"Docs","slug":"docs","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"rockboxzig","siteName":"Rockbox Daemon","title":"Erlang - Rockbox Daemon","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-13T15:14:41.257Z","originalFileLocation":"bindings/erlang.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Rockbox Daemon\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Erlang - Rockbox Daemon\">\u003cmeta data-mint-head property=\"og:description\" content=\"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rockbox Daemon\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://rockboxzig.mintlify.app/bindings/erlang\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rockboxzig.mintlify.site/_mintlify/api/og/v2?division=Native+engine+bindings\u0026amp;title=Erlang\u0026amp;description=The+shared+BEAM+native+layer+%E2%80%94+a+raw+erl_nif+surface+over+the+Rockbox+C+ABI%2C+reused+by+the+Elixir+and+Gleam+bindings.\u0026amp;theme=8993cbb32a9990bfc28bed57\u0026amp;signature=60a1364eab454de575a1bc0f06066ce93f58c4a61fc4378f814936f2516367d4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Erlang - Rockbox Daemon\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rockboxzig.mintlify.site/_mintlify/api/og/v2?division=Native+engine+bindings\u0026amp;title=Erlang\u0026amp;description=The+shared+BEAM+native+layer+%E2%80%94+a+raw+erl_nif+surface+over+the+Rockbox+C+ABI%2C+reused+by+the+Elixir+and+Gleam+bindings.\u0026amp;theme=8993cbb32a9990bfc28bed57\u0026amp;signature=60a1364eab454de575a1bc0f06066ce93f58c4a61fc4378f814936f2516367d4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/rockboxzig/pcYORXdXdl3xldRO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rockbox Daemon\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF6B00\">\u003clink data-mint-head rel=\"canonical\" href=\"https://rockboxzig.mintlify.app/bindings/erlang\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/bindings/erlang.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://rockboxzig.mintlify.app/#organization\",\"name\":\"Rockbox Daemon\",\"url\":\"https://rockboxzig.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rockboxzig/9kP-H_jRBkIO2KOF/logo/light.svg?fit=max\u0026auto=format\u0026n=9kP-H_jRBkIO2KOF\u0026q=85\u0026s=aef84576565438310e1b68d08aea8441\"}},{\"@type\":\"WebSite\",\"@id\":\"https://rockboxzig.mintlify.app#website\",\"name\":\"Rockbox Daemon\",\"url\":\"https://rockboxzig.mintlify.app\",\"publisher\":{\"@id\":\"https://rockboxzig.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://rockboxzig.mintlify.app/bindings/erlang#webpage\",\"url\":\"https://rockboxzig.mintlify.app/bindings/erlang\",\"name\":\"Erlang\",\"description\":\"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\",\"dateModified\":\"2026-07-13T15:14:41.257Z\",\"isPartOf\":{\"@id\":\"https://rockboxzig.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://rockboxzig.mintlify.app/bindings/erlang#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://rockboxzig.mintlify.app/bindings/erlang#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Native engine bindings\",\"item\":\"https://rockboxzig.mintlify.app/bindings/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Erlang\",\"item\":\"https://rockboxzig.mintlify.app/bindings/erlang\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://rockboxzig.mintlify.app/bindings/erlang#article\",\"headline\":\"Erlang\",\"name\":\"Erlang\",\"description\":\"The shared BEAM native layer — a raw erl_nif surface over the Rockbox C ABI, reused by the Elixir and Gleam bindings.\",\"url\":\"https://rockboxzig.mintlify.app/bindings/erlang\",\"mainEntityOfPage\":{\"@id\":\"https://rockboxzig.mintlify.app/bindings/erlang#webpage\"},\"dateModified\":\"2026-07-13T15:14:41.257Z\",\"publisher\":{\"@id\":\"https://rockboxzig.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://rockboxzig.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rockbox Daemon\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Rockbox Daemon\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/bindings/erlang.md","siteName":"Rockbox Daemon","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/tsirysndr/rockboxd"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/tXPrgcPKSt"},{"anchor":"Releases","icon":"rocket","href":"https://github.com/tsirysndr/rockboxd/releases"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/overview"}]},{"tab":"Bindings","groups":[{"group":"Native engine bindings","pages":[{"title":"Native engine bindings","icon":"plug","href":"/bindings/overview"},{"title":"Python","icon":"python","href":"/bindings/python"},{"title":"Go","icon":"golang","href":"/bindings/go"},{"title":"TypeScript","icon":"square-js","href":"/bindings/typescript"},{"title":"Ruby","description":"Rockbox DSP, metadata, and playback in Ruby via fiddle — no native extension to compile.","icon":"gem","href":"/bindings/ruby"},{"title":"Erlang","icon":"layer-group","href":"/bindings/erlang"},{"title":"Elixir","description":"Rockbox DSP, metadata, and playback in Elixir via an erl_nif shim over the C ABI.","icon":"droplet","href":"/bindings/elixir"},{"title":"Gleam","icon":"star","href":"/bindings/gleam"},{"title":"Swift","icon":"swift","href":"/bindings/swift"},{"title":"Kotlin","icon":"code","href":"/bindings/kotlin"},{"title":"Clojure","icon":"lambda","href":"/bindings/clojure"}]}]}]},"basePath":"","title":"Erlang - Rockbox Daemon","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}