Seed-VC 歌声转换
通用模型 · SeedVC
返回接口首页
AI 一句话对接
把下面这句话复制给 AI 编程助手(Claude Code、Cursor、Codex 等),它会读取本文档并完成接口对接。
请帮我对接这个接口,接口说明文档为 https://api.tecmz.com/m/CloudGeneral/SeedVC
复制提示词
模型说明
模型 ID:SeedVC 通用模型 价格:8算力点/分钟
基于 Seed-VC 的零样本歌声转换与语音转换模型,可将输入歌唱音频转换为参考音色的歌声,支持 F0 音高条件与自动音高对齐

输入要求

  • 源音频与参考音频必须是公网可访问的链接,支持 wav、mp3、flac、ogg、m4a 格式
  • 参考音频建议 5-10 秒、单人声、背景音干净,音色还原更准确
  • 源音频带伴奏时转换后保留伴奏,人声分离效果取决于源音频质量

计费说明

按生成音频时长计费:8 算力点/分钟,不足 1 分钟按 1 分钟计(如生成 15 秒按 1 分钟计费)。

效果建议

  • diffusion_steps 推荐 30-50:步数越高音质越好,耗时也越长
  • 需要保留原唱旋律与音高走向时保持 f0_condition=true
  • 跨性别音色转换时可用 pitch_shift(半音)微调音高,正数升调、负数降调
  • 参数相同且 seed 相同时结果可复现,便于固定效果批量生成
接口地址
操作 请求方式 地址
提交任务 POST https://api.tecmz.com/open_api/cloud_general/queue
查询任务 POST https://api.tecmz.com/open_api/cloud_general/query
可用性检查 POST https://api.tecmz.com/open_api/cloud_general/available
请求头携带 Authorization: Bearer <AppSecret>(AppId / AppSecret 见 接口管理); 提交任务成功后建议每 10 秒调用一次查询任务接口,直到 status 为 SUCCESS 或 FAIL。
请求参数
通用参数
参数 必须 类型 说明
model 是 string 目标模型 ID,本模型固定为 SeedVC
config 否 object 模型专属字段(本模型的 config 参数见下表)
param 否 object 模型通用参数(本模型的 param 参数见下表)
outId 否 string 外部业务 ID,最长 100 字符,便于业务侧关联任务
callback 否 string 任务结果回调地址,最长 200 字符
config 参数
参数必须类型默认值说明
type是stringvoiceConversion模型类型
param 参数
参数必须类型默认值说明
source是string-源歌唱音频;支持 wav、mp3、flac、ogg、m4a 格式,需公网可访问的文件链接
target是string-参考音频(目标音色);支持 wav、mp3、flac、ogg、m4a 格式,需公网可访问的文件链接
diffusion_steps否number30扩散步数;推荐 30-50 步
length_adjust否number1.0长度调整
inference_cfg_rate否number0.7CFG 比率
f0_condition否booltrue启用 F0 音高条件;开启后保留原唱歌的旋律和音高走向
auto_f0_adjust否booltrue自动 F0 调整;自动将源音频音高对齐到参考音频
pitch_shift否number0音高偏移(半音)
seed否number0随机种子
返回结果
提交任务返回
{
    "code": 0,
    "msg": "ok",
    "data": {
        "taskId": "1"
    }
}
查询任务返回
{
    "code": 0,
    "msg": "ok",
    "data": {
        "taskId": "1",
        "status": "SUCCESS",
        "statusRemark": "",
        "result": { }
    }
}
status 取值:QUEUE(排队中)、PROCESS(处理中)、 SUCCESS(成功)、FAIL(失败,失败原因见 statusRemark)。
result 字段
字段类型说明
result.urlstring转换后音频(文件链接)
调用示例
请求体(JSON)
{
    "model": "SeedVC",
    "config": {
        "type": "voiceConversion"
    },
    "param": {
        "source": "https://example.com/source.wav",
        "target": "https://example.com/target.wav"
    }
}
PHP(提交任务 + 轮询结果)
<?php
$baseUrl = 'https://api.tecmz.com/open_api/cloud_general';
$token = '<YOUR_API_TOKEN>';

// 1. 提交任务
$data = [
    'model' => 'SeedVC',
    'config' => [
        'type' => 'voiceConversion',
    ],
    'param' => [
        'source' => 'https://example.com/source.wav',
        'target' => 'https://example.com/target.wav',
    ],
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . '/queue');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer ' . $token,
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = json_decode(curl_exec($ch), true);
if (empty($result) || $result['code'] != 0) {
    exit('提交失败:' . (isset($result['msg']) ? $result['msg'] : '未知错误'));
}
$taskId = $result['data']['taskId'];

// 2. 轮询查询结果(建议 10 秒一次)
while (true) {
    curl_setopt($ch, CURLOPT_URL, $baseUrl . '/query');
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['taskId' => $taskId]));
    $ret = json_decode(curl_exec($ch), true);
    $status = isset($ret['data']['status']) ? $ret['data']['status'] : '';
    if ($status == 'SUCCESS') {
        print_r($ret['data']['result']);
        break;
    }
    if ($status == 'FAIL') {
        exit('生成失败:' . $ret['data']['statusRemark']);
    }
    sleep(10);
}
curl_close($ch);
示例中的地址、Token 需替换为实际值;接口基础说明见 通用模型 接口文档。
展开
QQ
微信
公众号
客服