跳转到主要内容

接口

POST /api/v1/music/soundfx
异步接口。 返回 task_id,通过 获取任务 轮询结果。 通过自然语言描述生成自定义音效。适用于游戏音频、UI 音效、环境氛围音效和音乐制作素材。支持中英文描述。

请求参数

字段类型是否必填说明
sound_descstring必填音效的文字描述,支持中英文(如 "铁皮屋顶上的大雨声""heavy rain on a tin roof")。
sound_typestring"loop" 为循环音效,"one-shot" 为单次音效。默认 "one-shot"
sound_bpminteger每分钟节拍数(用于循环音效)。
sound_keystring音调(如 "C""Am")。
mvstring模型版本覆盖
callback_urlstring任务完成时的 Webhook 回调 URL。参见 Webhook 回调
retention_daysinteger音频文件保存天数。默认 7

响应

{
  "code": 0,
  "message": "ok",
  "request_id": "req-1710000000000",
  "data": {
    "task_id": "64f3a1b2c8d9e0f1a2b3c4d5",
    "status": "queuing"
  }
}

示例

中文描述:
curl -X POST https://api.example.com/api/v1/music/soundfx \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "sound_desc": "森林中的鸟鸣声,清晨的宁静氛围",
    "sound_type": "loop"
  }'
英文描述:
curl -X POST https://api.example.com/api/v1/music/soundfx \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "sound_desc": "Thunderstorm with distant thunder and heavy rain",
    "sound_type": "loop",
    "sound_bpm": 120
  }'