Hearing

Choose how to hear music

POST/api/hearing/use
Admin. Needs an unlock token (x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.

Turns that way on: this computer's sound, a browser's microphone, or a sound input on a Pi (and server capture on or off).

Request body application/json

choicestringrequired
One of "computer" "mic" "pi" ""

Responses

200OKapplication/json
platformstring
methodstring
problemany | null
recommendedstring
One of "computer" "mic" "pi"
computerobject
piobject
captureobject

Server capture.

outputany

The sound output playing now.

400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/hearing/use' \
  -H 'content-type: application/json' \
  -d '{
  "choice": "computer"
}'
Response
{
  "platform": "string",
  "method": "string",
  "problem": null,
  "recommended": "computer",
  "computer": {
    "kind": "string",
    "source": "string",
    "why": "string",
    "on": true,
    "running": true,
    "steps": [
      {
        "id": "string",
        "label": "string",
        "state": "ok"
      }
    ]
  },
  "pi": {
    "available": true,
    "source": "string",
    "label": "string",
    "on": true
  },
  "capture": {},
  "output": null
}
Edit on GitHub