淡出
- 为已有音轨添加结尾淡出效果,异步任务
- 参数与「淡入」完全一致,只是作用位置在末尾
- 常与淡入配合做完整的首尾处理
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY引用源音轨
产出源音轨的那次任务的标识。缺失或无法解析出源音轨时,提交阶段立即返回 400。
从源任务结果的 data.result.music[] 中选取曲目,默认 1,从 1 起始。
The identifier of the task that produced the source track. When it's missing or the source track can't be resolved, submission returns a 400 immediately.
Selects the track from the source task's data.result.music[], default 1, starting at 1.
请求参数
音频模型,省略时默认为 suno。
淡出时长,单位秒。须大于 0 且不超过源音轨的已知时长,允许小数秒。
处理后音轨的标题,默认 Untitled。
The audio model; defaults to suno when omitted.
Fade-out length in seconds. Must be greater than 0 and no longer than the source track's known duration; fractional seconds allowed.
The title of the processed track; defaults to Untitled.
与淡入的对照
| 项目 | 淡入 | 淡出 |
|---|---|---|
| 路径 | fadeIn | fadeOut |
| 作用位置 | 音频开头 | 音频结尾 |
| 参数 | 完全一致 | 完全一致 |
淡出时长通常可以比淡入长一些。听众对「慢慢消失」的容忍度比「慢慢出现」高,2 到 4 倍的差距都常见。
本端点没有版本参数,传 version 会被忽略,也不影响计费。
| Item | Fade in | Fade out |
|---|---|---|
| Path | fadeIn | fadeOut |
| Position | Start of the audio | End of the audio |
| Parameters | Identical | Identical |
Fade-out can usually be longer than fade-in. Listeners tolerate "slowly disappearing" more than "slowly appearing"; a 2 to 4× difference is common.
This endpoint has no version parameter; passing version is ignored and doesn't affect billing.
响应与轮询
响应状态码。
提交成功为 submitted。
任务唯一标识。
轮询用 GET /v1/music/tasks/{task_id},间隔 3 到 5 秒,典型耗时 30 到 120 秒。终态为 completed 或 failed。完成后从 data.result.music[] 的 audio_url 取音频,失败原因见 data.error.message。
The response status code.
submitted on successful submission.
The unique task identifier.
Poll with GET /v1/music/tasks/{task_id} every 3 to 5 seconds; typical duration is 30 to 120 seconds. Terminal states are completed or failed. On completion, take the audio from audio_url in data.result.music[]; the failure reason is in data.error.message.
首尾都要淡入淡出怎么办
这两个接口是独立操作,不能一次搞定两头。做法是串联:
- 先调
fadeIn拿到task_id - 等它完成后,用新的
task_id再调fadeOut
顺序反过来也可以。注意第二步要用第一步产出的 task_id,不是最初那个。
每次处理都会重新编码。首尾各处理一次意味着两次编码,音质会有轻微损失。对音质要求高的场景,考虑在自己那边用无损工具做首尾处理。
These are separate operations and can't do both at once. Chain them:
- Call
fadeInto get atask_id - Once it completes, call
fadeOutwith the newtask_id
The reverse order works too. Note the second step uses the task_id produced by the first, not the original.
Each processing step re-encodes. Fading both ends means two encodes and a slight quality loss. For quality-critical work, consider doing the fades locally with lossless tools.
错误码
For error response formats, status codes, and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
提交一个任务并拿到 task_id:
提交成功只表示任务已受理。真正的产物要拿返回的 task_id 去任务查询接口轮询,status 变成 completed 之后才有结果。
Submit a task and get a task_id:
A successful submission only means the task was accepted. To get the actual output, poll the task query endpoint with the returned task_id; results appear only after status becomes completed.