{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53",
"instruments": [
{
"name": "Acoustic Guitar (steel)",
"notes": [
{
"end": 0.203125,
"pitch": 55,
"start": 0.10416666666666667,
"velocity": 0.30708661417322836
},
{
"end": 0.203125,
"pitch": 59,
"start": 0.10416666666666667,
"velocity": 0.2204724409448819
},
{
"end": 0.203125,
"pitch": 62,
"start": 0.10416666666666667,
"velocity": 0.2204724409448819
}
]
},
{
"name": "Acoustic Bass",
"notes": [
{
"end": 0.8125,
"pitch": 43,
"start": 0.515625,
"velocity": 0.6771653543307087
},
{
"end": 2.5833333333333335,
"pitch": 43,
"start": 2.484375,
"velocity": 0.5433070866141733
},
{
"end": 2.8854166666666665,
"pitch": 35,
"start": 2.5885416666666665,
"velocity": 0.5984251968503937
}
]
},
{
"name": "drums",
"notes": [
{
"end": 0.5166666666666666,
"pitch": 36,
"start": 0.515625,
"velocity": 0.6062992125984252
},
{
"end": 0.8135416666666666,
"pitch": 38,
"start": 0.8125,
"velocity": 0.33858267716535434
},
{
"end": 0.8135416666666666,
"pitch": 42,
"start": 0.8125,
"velocity": 0.33858267716535434
}
]
},
{
"name": "Synth Choir",
"notes": [
{
"end": 21.265625,
"pitch": 66,
"start": 20.671875,
"velocity": 0.25984251968503935
},
{
"end": 21.265625,
"pitch": 74,
"start": 20.671875,
"velocity": 0.41732283464566927
},
{
"end": 21.265625,
"pitch": 69,
"start": 20.671875,
"velocity": 0.25984251968503935
}
]
}
]
}
}
音频转 MIDI
音频转 MIDI:任务完成回调
创建任务时传了 callBackUrl,任务成功或失败后 DreamTo 向该地址发送此 POST 请求(只发送一次):成功时为 {"code": 200, "msg": "success", "data": {"taskId", "instruments"}},data.taskId 为任务 ID,instruments 为识别出的乐器及其音符(name、notes[].pitch/start/end/velocity);失败时 code 为失败代码(非 200),msg 为原因,data 只有 taskId。用 X-DreamTo-Signature 校验来源,返回任意 2xx 表示已收到。
WEBHOOK
sunoTaskCompleted
{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53",
"instruments": [
{
"name": "Acoustic Guitar (steel)",
"notes": [
{
"end": 0.203125,
"pitch": 55,
"start": 0.10416666666666667,
"velocity": 0.30708661417322836
},
{
"end": 0.203125,
"pitch": 59,
"start": 0.10416666666666667,
"velocity": 0.2204724409448819
},
{
"end": 0.203125,
"pitch": 62,
"start": 0.10416666666666667,
"velocity": 0.2204724409448819
}
]
},
{
"name": "Acoustic Bass",
"notes": [
{
"end": 0.8125,
"pitch": 43,
"start": 0.515625,
"velocity": 0.6771653543307087
},
{
"end": 2.5833333333333335,
"pitch": 43,
"start": 2.484375,
"velocity": 0.5433070866141733
},
{
"end": 2.8854166666666665,
"pitch": 35,
"start": 2.5885416666666665,
"velocity": 0.5984251968503937
}
]
},
{
"name": "drums",
"notes": [
{
"end": 0.5166666666666666,
"pitch": 36,
"start": 0.515625,
"velocity": 0.6062992125984252
},
{
"end": 0.8135416666666666,
"pitch": 38,
"start": 0.8125,
"velocity": 0.33858267716535434
},
{
"end": 0.8135416666666666,
"pitch": 42,
"start": 0.8125,
"velocity": 0.33858267716535434
}
]
},
{
"name": "Synth Choir",
"notes": [
{
"end": 21.265625,
"pitch": 66,
"start": 20.671875,
"velocity": 0.25984251968503935
},
{
"end": 21.265625,
"pitch": 74,
"start": 20.671875,
"velocity": 0.41732283464566927
},
{
"end": 21.265625,
"pitch": 69,
"start": 20.671875,
"velocity": 0.25984251968503935
}
]
}
]
}
}
请求头
请求体
application/json
响应
200
返回任意 2xx 状态码表示已收到;超时(10 秒)或非 2xx 时在 1、5、30 分钟后重试,最多投递 4 次。

