Skip to content

全功能异步接口 v2/* #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 5 tasks
zhzLuke96 opened this issue Nov 6, 2024 · 2 comments
Open
1 of 5 tasks

全功能异步接口 v2/* #187

zhzLuke96 opened this issue Nov 6, 2024 · 2 comments
Labels
Story Next iteration summary and TODO list

Comments

@zhzLuke96
Copy link
Member

zhzLuke96 commented Nov 6, 2024

背景

现在很多内部功能其实还是没有完全释放出来,比如 voice clone 流程基本触发不到,并且用 tts api 单次克隆也很麻烦
还有比如任务队列的需求,也很有必要开发,所以准备开发 v2 api

基本方向:所有兼容接口 google openai xtts 这些均保留在 v1 spec 下面,v2 是一套完全独立的 api,基于 job queue 和 文件流 管理

TODOs

  • /v2/tts post api,可以控制所有 tts pipeline context,并且可以接受克隆参数(即参考音频)
    • /v2/tts 单元测试
  • /v2/file 文件api,输出文件流独立于生成接口
  • /v2/job/* 任务队列api
  • v2 api 文档
@zhzLuke96 zhzLuke96 added the Story Next iteration summary and TODO list label Nov 6, 2024
zhzLuke96 added a commit that referenced this issue Nov 10, 2024
@zhzLuke96
Copy link
Member Author

v2系列api涉及到数据流管理和任务队列,还未完善,但是 /v2/tts 几乎已经可用 (缺少测试)

下面我写一些简单的 /v2/tts 使用说明,以防有人需要使用 /v2/tts 接口但是现在缺乏文档支持

  1. v2/tts 如何指定其他模型
    设置参数 tts.mid ,参数body大概类似如下:
{
  "text": "你好。",
  "tts": {
    "mid": "cosy-voice"
  }
}
  1. /v2/tts 如何指定说话人

可以使用两种方式指定说话人

  • 指定说话人id或者说话人name,使用 /data/speakers 文件夹下面的说话人 (*.spkv1.json文件)
{
  "text": "你好。",
  "spk": {
    "from_spk_id": "9609c6a2d27b485fb0c8aec05a684579"
  }
}
{
  "text": "你好。",
  "spk": {
    "from_spk_name": "mona"
  }
}
  • 直接上传参考音频
{
  "text": "你好。",
  "spk": {
    "from_ref": {
      "wav_b64": "SUQzB...<base64编码音频文件的字符串>",
      "text": "<对应参考音频的文本>"
    }
  }
}
  1. 如何调用 api ?如何测试 api?
    推荐参考这个示例代码:
    https://github.com/lenML/Speech-AI-Forge/blob/main/examples/javascript/tts_v2_full.mjs
    其中有完整的接口参数,以及演示了如何传递 base64 参考音频

@zhzLuke96
Copy link
Member Author

如果有人需要看完整 v2 api 文档,可以看这个
https://github.com/lenML/Speech-AI-Forge/blob/main/docs/api_v2.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Story Next iteration summary and TODO list
Projects
None yet
Development

No branches or pull requests

1 participant