cocos_add_audio_source
Add audio sources to Cocos Creator scenes by attaching cc.AudioSource components with configurable playback settings like volume, looping, and auto-play.
Instructions
Attach cc.AudioSource. clip_uuid references an audio-clip asset.
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": {
"scene_path": "<scene_path>",
"node_id": "<node_id>"
},
"name": "cocos_add_audio_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| clip_uuid | No | ||
| play_on_awake | No | ||
| loop | No | ||
| volume | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |