# audio.add

Source: https://docs.lightair.app/developers/remote-api/audio.add

> Adds a sound source and its mixer track: a microphone, the desktop's sound or an app's sound.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Audio. Script plugins need the `project.write` permission.

Sound has no picture, so no object is added to a scene. A microphone's `device` comes from [capture.targets](/developers/remote-api/capture.targets) with `kind: microphone`.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `kind` | `string` | no | `microphone`, `desktop` or `app`. Default `microphone`. |
| `device` | `string` | no | A microphone's device. |
| `app` | `string` | no | The app whose sound to take. |
| `name` | `string` | no | The track's name. Default "Mic", "Desktop audio" or "App audio". |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `source` | `string` | no | The new source's id. |
| `track` | `string` | no | The new track's id. |

## Errors

Invalid params (-32602) for another kind.

## Events

- `workspace.changed`

## From an AI agent

The MCP server's `audio (action: add_input)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "audio.add", "params": { "kind": "desktop" } }
```

Result:

```json
{ "source": "019ad3f4-2b3c-7d4e-9f50-6b7c8d9e0f1a", "track": "019ad3f4-3c4d-7e5f-a061-7c8d9e0f1a2b" }
```

## Related

- [capture.targets](https://docs.lightair.app/developers/remote-api/capture.targets.md)
- [audio.set](https://docs.lightair.app/developers/remote-api/audio.set.md)
