Skip to content

Playback Tools

Twelve tools provide playback control, state inspection, seeking, and volume management.

Playback control

ToolBridge methodParametersResultDescription
fb2k_playback_playplayback.playnonesuccess: trueStart or resume playback
fb2k_playback_pauseplayback.pausenonesuccess: truePause playback
fb2k_playback_stopplayback.stopnonesuccess: trueStop playback
fb2k_playback_nextplayback.nextnonesuccess: trueSkip to the next track
fb2k_playback_previousplayback.previousnonesuccess: trueGo to the previous track
fb2k_playback_play_pauseplayback.playPausenonesuccess: true; isPlaying: booleanToggle play and pause; isPlaying reports the playing state after the toggle

State

fb2k_playback_get_state

Gets the current playback state and capability flags.

  • Parameters: none
  • Bridge method: playback.getState

Example result:

json
{
  "state": "playing",
  "canSeek": true,
  "canPause": true
}
FieldTypeDescription
statestringplaying, paused, or stopped
canSeekbooleanWhether seeking is available
canPausebooleanWhether pausing is available

fb2k_playback_get_current_track

Gets detailed information about the current track. When nothing is playing, the result reports found: false.

  • Parameters: none
  • Bridge method: playback.getCurrentTrack

Example result while playing:

json
{
  "id": "D:\\\\Music\\\\Mili\\\\Redo.flac",
  "title": "Redo",
  "artist": "Mili",
  "album": "Millennium Mother",
  "albumArtist": "Mili",
  "genre": "Alternative",
  "date": "2018",
  "trackNumber": 1,
  "discNumber": 1,
  "duration": 263.5,
  "path": "file://D:\\\\Music\\\\Mili\\\\Redo.flac",
  "absolutePath": "D:\\\\Music\\\\Mili\\\\Redo.flac",
  "fullPath": "D:\\\\Music\\\\Mili\\\\Redo.flac",
  "subsong": 0,
  "fileSize": 28456789,
  "bitrate": 876,
  "sampleRate": 44100,
  "channels": 2,
  "codec": "FLAC"
}
FieldTypeDescription
idstringFull-path identity, including a subsong suffix when applicable
titlestringTrack title
artiststringTrack artist
albumstringAlbum title
albumArtiststringAlbum artist
genrestringGenre
datestringRelease date
trackNumberintegerTrack number
discNumberintegerDisc number
durationnumberDuration in seconds
pathstringOriginal foobar2000 path
absolutePathstringNormalized absolute path without a subsong suffix
fullPathstringAbsolute path plus an optional `
subsongintegerSubsong index, for example for a CUE track
fileSizeintegerFile size in bytes
bitrateintegerBitrate in kbps
sampleRateintegerSample rate in Hz
channelsintegerChannel count
codecstringCodec name

Example result while stopped:

json
{ "success": true, "found": false, "playing": false }

fb2k_playback_get_position

Gets the playback position and total duration.

  • Parameters: none
  • Bridge method: playback.getPosition

Example result:

json
{
  "position": 45.2,
  "duration": 263.5,
  "subsong": 0,
  "path": "D:\\\\Music\\\\Mili\\\\Redo.flac"
}
FieldTypeDescription
positionnumberCurrent position in seconds
durationnumberTotal duration in seconds
subsongintegerSubsong index
pathstringCurrent file path

Seeking and volume

fb2k_playback_set_position

Seeks to a playback position.

  • Bridge method: playback.setPosition
ParameterTypeRequiredConstraints
secondsnumberYesTarget position in seconds; minimum 0

fb2k_playback_get_volume

Gets the current volume and mute state.

  • Parameters: none
  • Bridge method: playback.getVolume

Example result:

json
{
  "volume": 75,
  "volumeDb": -6.2,
  "muted": false,
  "isMuted": false
}
FieldTypeDescription
volumenumberLinear volume from 0 to 100
volumeDbnumberVolume in dB
mutedbooleanMute state
isMutedbooleanAlias of muted

fb2k_playback_set_volume

Sets the playback volume.

  • Bridge method: playback.setVolume
ParameterTypeRequiredConstraints
volumenumberYesLinear volume from 0 to 100 inclusive