# Protocol: audio

The `audio` commands a program sends to a running game, as the engine describes them: what each takes, what it answers and what it does. Back to [all commands](../protocol-commands.md).

## audio.requests

`audio.requests {since?: integer} -> {step: integer, made: integer, sounds: [text], requests: [record], music: record}` · read, read-only

Lists what the game asked to be heard. Sound is output only: requests are written down whether or not anything plays them, and are never part of the world or its checksum.

| Parameters | Type | Meaning |
| --- | --- | --- |
| `since?` | integer | Only requests made in this step or a later one. Left out: all that are kept. To follow a game, ask again with the step of the last answer plus one. |

| Result | Type | Meaning |
| --- | --- | --- |
| `step` | integer | How many fixed steps have run. |
| `made` | integer | How many requests the game has made since it was loaded. Only the latest 256 are kept, which a busy game makes in a few seconds: read every few steps to miss none. |
| `sounds` | [text] | The sounds the game loaded: the names a request can use. |
| `requests` | [record] | The latest 256, oldest first: {step, request, name, volume, pitch, pan, seconds}. request is "play", "music", "stop" (after fading out over seconds), "volume" (of everything), "effects" (the volume of sounds played once), "pause", "resume" or "fade" (the music's own volume moving to a level over seconds); step is the step it was made in, 0 for one made while loading; pan is where a played sound is heard from, -1 left to 1 right; name, volume, pitch, pan and seconds are null where the request has none. game.reset starts the list again, and game.restore puts it back as it was at the snapshot. |
| `music` | record | The music playing now, as the requests say: {name, since, paused}, since the step it was asked for in (0 while loading) however long ago, paused while a pause is not resumed. null before music is asked for, and once it is stopped. Put back with the game by game.restore, and by a seek as the steps played again ask. |
