# audio

> 音频操作。play: 播放（支持 AudioStreamPlayer/2D/3D）。stop: 停止。set_param: 设置参数（volume_db/pitch_scale/bus）。query: 查询播放状态。运行时操作，仅影响当前执行上下文。如需持久化，请编辑 .tscn 文件。

| 属性 | 值 |
|------|-----|
| 所属层 | headless |
| 安全级别 | guarded |
| 需要 Godot | 是 |
| 需要编辑器 | 否 |
| 只读 | 否 |
| 长耗时 | 否 |

## Actions

- `audio_play`
- `audio_stop`
- `audio_set_param`
- `audio_query`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (4 项) | ✓ | 操作类型 |
| `project_path` | string |  | Godot 项目目录路径（可选，默认使用 GODOT_PROJECT_PATH 环境变量或当前目录） |
| `node_path` | string |  | 音频节点路径 |
| `stream_path` | string |  | play: 音频资源路径（res://...），不传则播放已配置的 |
| `volume_db` | number |  | play: 音量（dB，-80 到 24） |
| `pitch_scale` | number |  | play: 音调缩放（0.01 到 100） |
| `bus` | string |  | play/set_param: 音频总线名称 |
| `from_position` | number |  | play: 从指定位置开始播放（秒） |
| `param` | enum: volume_db | pitch_scale | bus |  | set_param: 参数名 |
| `value` | any |  | set_param: 参数值（number for volume_db/pitch_scale, string for bus） |
| `load_autoloads` | boolean |  | 是否加载 Autoload 上下文（默认 true） |

## 风险分布

读 3 / 写 1

---
<!-- AUTO-GENERATED by scripts/gen-tool-docs.mjs from capability-matrix.json v0.32.21. DO NOT edit manually; re-run npm run gen:tool-docs after tool changes. -->
