cocos_add_audio_file
Add audio files (mp3/wav/ogg) to Cocos Creator projects by copying them to the resources folder and generating metadata for runtime loading.
Instructions
Copy an audio file (mp3/wav/ogg) into assets/resources/ + write meta.
The file is placed under resources/ so it can be loaded at runtime via resources.load(). Returns {path, rel_path, uuid}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>",
"src_path": "<src_path>"
},
"name": "cocos_add_audio_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| src_path | Yes | ||
| rel_path | No | ||
| uuid | No |