REST API: Speaker and microphone. Generated from the OpenAPI document.
Audio format
GET /v1/audio
The robot speaks and hears mono 16-bit PCM at 16 kHz.
Token: required · Lease: not needed
Stream the microphones
GET /v1/audio/microphone
An endless WAV (or raw s16le) stream, mono 16 kHz. The robot only mixes microphone audio while someone listens.
Token: required · Lease: not needed
| Parameter | In | Type | Required | Meaning |
|---|---|---|---|---|
format | query | StreamFormat | no |
| Status | Meaning | Body |
|---|---|---|
| 200 | Endless mono 16 kHz 16-bit stream of the microphones | audio/wav, application/octet-stream |
| 401 | Missing or wrong token | ErrorBody |
| 503 | Too many streams open | ErrorBody |
Play audio on the speakers
POST /v1/audio/speaker
16-bit PCM WAV at any rate and channel count (converted to 16 kHz mono) or raw s16le 16 kHz mono, at most 4 MiB. Queued after what is playing.
Token: required · Lease: required (Nao-Lease header)
Request body (application/octet-stream or audio/wav): 16-bit PCM WAV (any rate and channel count, converted to 16 kHz mono) or raw s16le 16 kHz mono; at most 4 MiB
| Status | Meaning | Body |
|---|---|---|
| 202 | Queued for the speakers | Queued |
| 409 | Not the active lease | ErrorBody |
| 413 | Larger than 4 MiB | ErrorBody |
| 415 | Unsupported content type | ErrorBody |
| 422 | Not usable audio | ErrorBody |
| 428 | No Nao-Lease header | ErrorBody |
Stop the speakers
DELETE /v1/audio/speaker
Drops queued speaker audio.
Token: required · Lease: required (Nao-Lease header)
| Status | Meaning | Body |
|---|---|---|
| 204 | Queued speaker audio dropped | |
| 409 | Not the active lease | ErrorBody |
| 428 | No Nao-Lease header | ErrorBody |
Speaker volume
GET /v1/audio/volume
What the mixer holds now. Every boot starts at 65 %; changes are not kept across reboots.
Token: required · Lease: not needed
| Status | Meaning | Body |
|---|---|---|
| 200 | The speaker volume | VolumeStatus |
| 401 | Missing or wrong token | ErrorBody |
| 503 | No mixer (simulator), or not read yet | ErrorBody |
Set the speaker volume
PUT /v1/audio/volume
Changes the mixer only, never the audio stream, so it does not pop. Applied within about
0.1 s; GET /v1/audio/volume reads it back. Not persistent: the next boot is at 65 % again.
Token: required · Lease: required (Nao-Lease header)
Request body (application/json)
VolumeRequest. A volume change. Give percent, muted or both; a percent above 0 also unmutes unless
muted is given too.
| Field | Type | Required | Meaning |
|---|---|---|---|
muted | boolean or null | no | |
percent | integer or null | no | 0 to 100. (0 to 100) |
| Status | Meaning | Body |
|---|---|---|
| 202 | Requested | VolumeRequest |
| 409 | Not the active lease | ErrorBody |
| 422 | Invalid input (percent outside 0..100, nothing given) | ErrorBody |
| 428 | No Nao-Lease header | ErrorBody |