Skip to content

audio.mix

Operation: audio.mix
Category: media
Tags: ffmpeg, audio, mix

Mix voiceover audio with background music at configurable volume

Type: Native (built-in)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)

NameTypeRequiredDefaultDescription
voiceover_urlAssetYesVoiceover audio URL/path
bgm_urlAssetNoBackground music URL/path
NameTypeDescription
urlAssetMixed audio URL
pathStringLocal file path
bgm_mixedBooleanWhether BGM was mixed in
{
"bgm_volume": 0.15
}

The bgm_volume parameter is overridable as a workflow-level input variable, so users can adjust per-run:

Terminal window
fab-workflow video/ai-shorts --input topic="..." --input bgm_volume=0.20
from fabric_workflow_sdk.stages.audio import mix_audio, remix_ducked
mixed = await mix_audio({"voiceover_path": "vo.mp3", "bgm_path": "bgm.mp3", "bgm_volume": 0.20})
ducked = await remix_ducked({**mixed, "transcript": [...]})

The bgm_volume parameter controls how much background music is ducked when voiceover is playing. Different content niches benefit from different levels:

NicheSuggested bgm_volumeRationale
Tech / Education0.10Prioritize voice clarity for information-dense content
Default0.15Balanced — audible music without competing with voice
Comedy / Entertainment0.20–0.25Music adds energy and comedic timing

In workflow YAML definitions, promote bgm_volume to a workflow-level input variable so callers can override per-run:

input:
bgm_volume: 0.15
nodes:
mix-audio:
op: audio.mix
params: { bgm_volume: "{{bgm_volume}}" }
import { WorkflowBuilder } from "@fabric-platform/sdk";
const workflow = new WorkflowBuilder("my-workflow")
.node("audio-mix", "tool", (n) =>
n.config({
operation: "audio.mix",
// ... node-specific config
})
)
.build();