state_audio

🟡 Incomplete

This API's output may have additions in the future.


Retrieve the current audio state.

Inputs

None

Outputs

FieldTypeDescription
queuearray of Song keys (unsigned integers)Array of Song keys that are in the queue, in order of what will be played next
queue_idxoptional (maybe-null) unsigned integerThe queue index festivald is currently on, null if no Song is set
playingbooleanIf festivald is currently playing
song_keyoptional (maybe-null) Song key (unsigned integer)The key of current Song, null if no Song is set
elapsedunsigned integerElapsed runtime of current Song in seconds
runtimeunsigned integerTotal runtime of current Song in seconds
repeatstring, one of song, queue, or offAudio repeat behavior. song means the Song will repeat after ending, queue means the whole queue will repeat after ending, off means the queue will be cleared and playback will stop when ending
volumeunsigned integer in between 0..100The current volume level
songoptional (maybe-null) Song objectThe current Song as an object, null if no Song is set

Example Request

festival-cli state_audio
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"state_audio"}'

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "queue": [
      14
    ],
    "queue_len": 1,
    "queue_idx": 0,
    "playing": false,
    "song_key": 14,
    "elapsed": 0,
    "runtime": 349,
    "repeat": "off",
    "volume": 25,
    "song": {
      "title": "いつか",
      "key": 14,
      "album": 9,
      "runtime": 349,
      "sample_rate": 44100,
      "track": 1,
      "disc": 1,
      "mime": "audio/x-flac",
      "extension": "flac"
    }
  },
  "id": 0
}