Lyrics API
English API reference for the lyrics family.
This page is the primary owner for the namespaces listed below. Method names, parameter keys, and return fields follow the C++ RegisterApi handlers.
lyrics
lyrics.exists
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Track path. Accepts path|subsong:N. |
Returns: {"error":"...","exists":"...","sources":"...","success":true}
js
const { exists, sources } = await fb2k.invoke('lyrics.exists', {
path: 'C:\\Music\\song.flac',
});lyrics.get
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | — | Falls back to the current playing track. |
source | string | No | any | Accepts embedded, file, or any. |
type | string | No | any | Accepts synced, unsynced, or any. |
format | string | No | any | Accepts lrc, txt, or any. |
Returns: {"available":true,"lyrics":"...","path":"...","source":"...","sourcePath":"...","success":true,"synced":"..."}
js
const { available, lyrics, synced } = await fb2k.invoke('lyrics.get', {
path: 'C:\\Music\\song.flac',
type: 'synced',
});lyrics.save
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | — | Track path the lyrics belong to. |
lyrics | string | Yes | — | Lyrics text to save; must be non-empty. |
target | string | string[] | No | file | Accepts file, embedded, config, all, or an array of the first three. |
format | string | No | lrc | Accepts lrc or txt and selects the sidecar extension. |
filename | string | No | — | Plain filename only. Used by the file and config targets. |
tagName | string | No | LYRICS | Used by the embedded target. |
Returns: {"error":"...","results":"...","success":true}
js
await fb2k.invoke('lyrics.save', {
path: 'C:\\Music\\song.flac',
lyrics: '[00:12.00]First line\n[00:18.50]Second line\n',
});Usage notes
lyrics.getusespathwhen supplied and otherwise resolves the current playing track.source,type, andformatdefault toany; successful results includesuccess,available, andpath, plussource,lyrics, andsyncedwhen lyrics are found. File-backed results additionally includesourcePath.- For a
path|subsong:Ncontainer path, file lookup checks the per-track sidecar before the shared sidecar.lyrics.existsreturns source labels such asfile:song.lrcand never treats a missingpathas a current-track request. lyrics.saverequires bothpathand non-emptylyrics.targetdefaults tofileand acceptsfile,embedded,config,all, or an array of the first three values. Thefilenamevalue must be a plain filename; path separators and traversal sequences are rejected.- The documented SDK helpers
fb.lyrics.get(...),fb.lyrics.exists(...), andfb.lyrics.save(...)are convenience wrappers. The public Bridge contract on this page remains the threelyrics.*methods. The<fb-lyrics-panel>component is a consumer, not a registered API method.