Skip to content

MCP: edit operations

audio.duck

Lowers a music item while speech sounds, with ramps before and after.

Last updated:

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#

ArgumentTypeRequiredNotes
attackstringnoA length, may be 0; the ramp down before speech. Default "0.2s".
gain_dbnumbernoChange of volume while speech sounds, -40 to -1; default -12.; min -40; max -1
item_idstringyesThe music: an audio item with no volume keyframes.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
releasestringnoA length, may be 0; the ramp up after speech. Default "0.5s".
speech_item_idsarray of stringyesClips 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

tools/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

batch.json
[
  {
    "op": "audio.duck",
    "args": {
      "gain_db": -12,
      "item_id": "itm_s6t7v8w9x0",
      "speech_item_ids": [
        "itm_m1n2p3q4r5"
      ]
    }
  }
]
Terminal
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json

Over HTTP

curl
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.