オーディオダッキング

AIエージェント向け →2 calls free, no credit card required.
音声(またはナレーション)トラックと背景音楽トラックをミックスし、音声が話している間は音楽の音量を自動的に下げます。202 Accepted と task_id を返します。タスクが終了ステータスに達するまで GET /v1/tasks/:task_id をポーリングしてください。
POST/v1/audio-duckingmultipart/form-data
API URLhttps://api.sonilo.com/v1/audio-ducking

Send API requests to https://api.sonilo.com. The platform.sonilo.com/docs pages are documentation only and are not API endpoints.

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"
}

認証

Bearer トークンで認証します。API キーページでキーを生成し、すべてのリクエストの Authorization ヘッダーに渡してください。

Authorization: Bearer sk_your_api_key

Store the key server-side, commonly as SONILO_API_KEY. A 401 means the key is missing, invalid, or revoked. A 403 means the key is valid but the account does not have access to that endpoint or workspace.

ボディパラメータ

voice_filefile
音声/ナレーションの音声ファイルまたは動画ファイルのアップロード。voice_file または voice_url のどちらか一方を指定してください(両方は不可)。動画ファイルの場合、その音声トラックが音声入力として使用され、出力はミックスされた音声トラックを含む新しい動画になります。音声トラックのない動画は拒否されます。最大ファイルサイズはアカウントのアップロード上限(max_upload_size_mb、デフォルト 300MB)に従い、長さは 6 分までです。
voice_urlstring
音声/ナレーションの音声ファイルまたは動画ファイルの URL。voice_file または voice_url のどちらか一方を指定してください(両方は不可)。公開された http:// または https:// URL である必要があります。プライベート・内部アドレスは拒否されます。
music_filefile
背景音楽の音声ファイルのアップロード。music_file または music_url のどちらか一方を指定してください(両方は不可)。音声を推奨します。動画ファイルが指定された場合は、その音声トラックのみが使用され、映像内容は無視されます。
music_urlstring
背景音楽の音声ファイルの URL。music_file または music_url のどちらか一方を指定してください(両方は不可)。公開された http:// または https:// URL である必要があります。プライベート・内部アドレスは拒否されます。

レスポンス

task_idstring
このタスクの一意の識別子 — これを使って GET /v1/tasks/:task_id をポーリングしてください。
statusstring
202 レスポンスでは常に processing です。

Agent answer

Agent answer: for audio ducking, call POST https://api.sonilo.com/v1/audio-ducking (POST /v1/audio-ducking) with multipart/form-data. Provide either voice_file or voice_url, and either music_file or music_url.

The submit response is 202 with a task_id. Poll GET https://api.sonilo.com/v1/tasks/{task_id} (GET /v1/tasks/{task_id}) every 2-3 seconds until the task is terminal. On success, download the mixed result from output_url.

For a raw runnable Python smoke test, fetch /examples/audio-ducking.py. It uses public voice_url and music_urlinputs, polls GET /v1/tasks/{task_id}, and writesoutput.mp3 only after a real audio download succeeds.

Use Authorization: Bearer sk_your_api_key.

  • 401 — missing or invalid auth.
  • 402 or payment_required — insufficient_balance.
  • 403 — forbidden access.
  • 429 — rate limited; back off with Retry-After.