Writes volume keyframes on the music item: its volume drops by gain_db over attack before each stretch of speech and returns over release after it. Speech stretches closer than the ramps are held low across the gap. The speech comes from the analysis of the speech items and is supplied by the service in resolved; the command never starts a job. The item must have no volume keyframes yet; keyframe.clear on volume undoes the ducking.
Arguments#
| Argument | Type | Required | Notes |
|---|---|---|---|
attack | string | no | A length, may be 0; the ramp down before speech. Default "0.2s". |
gain_db | number | no | Change of volume while speech sounds, -40 to -1; default -12.; min -40; max -1 |
item_id | string | yes | The music: an audio item with no volume keyframes.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
release | string | no | A length, may be 0; the ramp up after speech. Default "0.5s". |
speech_item_ids | array of string | yes | Clips or audio items that carry the speech.; at least 1 items; at most 20 items |
Errors#
Scope#
Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help audio.duck for the same description from the binary, or call the command_help tool.
Next steps#
As an MCP call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "edit",
"arguments": {
"project_id": "prj_7k2m9x4q1b",
"base_revision": 12,
"operations": [
{
"op": "audio.duck",
"args": {
"gain_db": -12,
"item_id": "itm_s6t7v8w9x0",
"speech_item_ids": [
"itm_m1n2p3q4r5"
]
}
}
]
}
}
}As a batch file for the CLI
[
{
"op": "audio.duck",
"args": {
"gain_db": -12,
"item_id": "itm_s6t7v8w9x0",
"speech_item_ids": [
"itm_m1n2p3q4r5"
]
}
}
]stuarty edit --project prj_7k2m9x4q1b --ops batch.json --jsonOver HTTP
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
-H "Authorization: Bearer $STUARTY_KEY" \
-H "Content-Type: application/json" \
-d '{
"base_revision": 12,
"operations": [
{
"op": "audio.duck",
"args": {
"gain_db": -12,
"item_id": "itm_s6t7v8w9x0",
"speech_item_ids": [
"itm_m1n2p3q4r5"
]
}
}
]
}'The ids in the example are illustrative: read the real ones with project_get.