Audio Mix With Background
Immutable Catalog Entry
This descriptor comes from the active versioned Portal catalog.
- Contract tier:
agent_ready - Risk:
write - Catalog version:
2026-07-12.3 - Descriptor hash:
e39fb55310f1e0d0b822380df80ab434483f765b838e2e06209bc8ca71ea982b
Use this to combine voice and background music with optional ducking and independent gains. It queues a new audio asset and preserves both inputs.
Request Body
{
"jsonrpc": "2.0",
"id": "ffmpeg-audio-mix-with-background-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.audio_mix_with_background",
"arguments": {
"voice_asset_id": "voice_asset_id_123",
"music_asset_id": "music_asset_id_123",
"ratio": "",
"bitrate": "",
"ducking": "",
"priority": "",
"attack_ms": "",
"threshold": "",
"music_gain": "",
"release_ms": ""
}
}
}
Arguments Schema
{
"type": "object",
"required": [
"voice_asset_id",
"music_asset_id"
],
"properties": {
"ratio": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Compressor ratio used for voice-driven music ducking."
},
"bitrate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional FFmpeg bitrate string accepted by the bounded operation."
},
"ducking": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether voice-driven music ducking is enabled."
},
"priority": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional queue priority configured by the server, such as urgent or batch."
},
"attack_ms": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Ducking compressor attack time in milliseconds."
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Signal threshold used to trigger ducking."
},
"music_gain": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Background-music gain multiplier within server limits."
},
"release_ms": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Ducking compressor release time in milliseconds."
},
"voice_gain": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Voice-track gain multiplier within server limits."
},
"output_format": {
"type": "string",
"default": "m4a",
"description": "Requested supported container or codec family for the new audio asset."
},
"music_asset_id": {
"type": "string",
"description": "Stable ID of the staged background music asset."
},
"voice_asset_id": {
"type": "string",
"description": "Stable ID of the staged voice or dialogue audio asset."
}
},
"additionalProperties": false
}
Output Schema
{
"type": "object",
"required": [
"job_id",
"cache_hit"
],
"properties": {
"job_id": {
"type": "string",
"description": "Stable ID used with the job readback tools."
},
"cache_hit": {
"type": "boolean",
"description": "Whether a matching completed result was reused."
},
"output_asset_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "Completed output asset IDs when immediately available from cache."
}
},
"additionalProperties": false
}
Code Examples
- cURL
- Node.js
- Python
curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "ffmpeg-audio-mix-with-background-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.audio_mix_with_background",
"arguments": {
"voice_asset_id": "voice_asset_id_123",
"music_asset_id": "music_asset_id_123",
"ratio": "",
"bitrate": "",
"ducking": "",
"priority": "",
"attack_ms": "",
"threshold": "",
"music_gain": "",
"release_ms": ""
}
}
}'
const response = await fetch('https://portal.madpanda3d.com/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "ffmpeg-audio-mix-with-background-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.audio_mix_with_background",
"arguments": {
"voice_asset_id": "voice_asset_id_123",
"music_asset_id": "music_asset_id_123",
"ratio": "",
"bitrate": "",
"ducking": "",
"priority": "",
"attack_ms": "",
"threshold": "",
"music_gain": "",
"release_ms": ""
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://portal.madpanda3d.com/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "ffmpeg-audio-mix-with-background-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.audio_mix_with_background",
"arguments": {
"voice_asset_id": "voice_asset_id_123",
"music_asset_id": "music_asset_id_123",
"ratio": "",
"bitrate": "",
"ducking": "",
"priority": "",
"attack_ms": "",
"threshold": "",
"music_gain": "",
"release_ms": ""
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 502 Upstream Error
{
"ok": true,
"message": "Tool ffmpeg.audio_mix_with_background executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}
{
"ok": false,
"classification": "upstream_http_error",
"message": "Upstream MCP returned a non-success status."
}