Docs menu

Audio Ducking

Mix a voice (or narration) track with a background music track, automatically lowering the music while the voice is speaking. Returns 202 Accepted with a task_id; poll GET /v1/tasks/:task_id until the task reaches a terminal status.

POST/v1/audio-duckingmultipart/form-data
curl -X POST https://api.sonilo.com/v1/audio-ducking \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "voice_file=@/path/to/voice.wav" \
  -F "music_file=@/path/to/music.mp3"
# => {"task_id": "3f9c1a2e-...", "status": "processing"}

curl https://api.sonilo.com/v1/tasks/3f9c1a2e-... \
  -H "Authorization: Bearer sk_your_api_key"
# poll until "status" is "succeeded" or "failed"
curl -X POST https://api.sonilo.com/v1/audio-ducking \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "voice_url=https://example.com/talking-head.mp4" \
  -F "music_url=https://example.com/music.mp3"
# => {"task_id": "3f9c1a2e-...", "status": "processing"}
{
  "task_id": "3f9c1a2e-...",
  "status": "processing"
}

Authorization

Authenticate via Bearer token. Generate keys at the API Keys page and pass them in the Authorization header on every request.

Authorization: Bearer sk_your_api_key

Body Parameters

voice_filefilerequired
Voice/narration audio or video file upload. Provide either voice_file or voice_url, not both. If this is a video file, its own audio track is used as the voice input and the output is a new video with the mixed audio track; a video with no audio track is rejected. Max file size is governed by your account's upload limit (max_upload_size_mb, default 300MB); duration is capped at 6 min.
voice_urlstringrequired
URL to a voice/narration audio or video file. Provide either voice_file or voice_url, not both. Must be a public http:// or https:// URL; private/internal addresses are rejected.
music_filefilerequired
Background music audio file upload. Provide either music_file or music_url, not both. Should be audio; if a video file is provided, only its audio track is used and the video content is ignored.
music_urlstringrequired
URL to a background music audio file. Provide either music_file or music_url, not both. Must be a public http:// or https:// URL; private/internal addresses are rejected.

Response

task_idstring
Unique identifier for this task — poll GET /v1/tasks/:task_id with it.
statusstring
Always processing on the 202 response.