Skip to content

派蒙语音 API

请求地址

POST 方法:/api/word/genshin

请求参数

参数名类型必填说明
contentstring输入路径,可以是文字、txt 路径或文件夹路径
modestring处理模式[三选一],text 文字模式,file 单文件模式、folder 文件夹批处理
voiceint发音人,示例:0
noise_scalefloat情感,取值范围[0.01~1],默认:0.6
noise_scale_wfloat发音长度,取值范围[0.01~1],默认:0.667
ratefloat语速,取值范围[0.01~2],默认:1.1

示例代码

python
import requests

url = 'http://127.0.0.1:5699/api/word/genshin'
data = {
    'content': '/path/to/text.txt',
    'mode': 'file',
    'voice': 0, # 派蒙ID为0
    'noise_scale': 0.6,
    'noise_scale_w': 0.667,
    'rate': 1.1
}
r = requests.post(url, data=data)
print(r.json())
import requests

url = 'http://127.0.0.1:5699/api/word/genshin'
data = {
    'content': '/path/to/text.txt',
    'mode': 'file',
    'voice': 0, # 派蒙ID为0
    'noise_scale': 0.6,
    'noise_scale_w': 0.667,
    'rate': 1.1
}
r = requests.post(url, data=data)
print(r.json())
js
let formData = new FormData();
formData.append("content", "/path/to/text.txt");
formData.append("mode", "file");
formData.append("voice", 0);
formData.append("noise_scale", 0.6);
formData.append("noise_scale_w", 0.667);
formData.append("rate", 1.1);

fetch("http://127.0.0.1:5699/api/word/genshin", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
let formData = new FormData();
formData.append("content", "/path/to/text.txt");
formData.append("mode", "file");
formData.append("voice", 0);
formData.append("noise_scale", 0.6);
formData.append("noise_scale_w", 0.667);
formData.append("rate", 1.1);

fetch("http://127.0.0.1:5699/api/word/genshin", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
js
curl -X POST -F 'content=@/path/to/text.txt' -F 'mode=file' -F 'voice=0' -F 'noise_scale=0.6' -F 'noise_scale_w=0.667' -F 'rate=1' http://127.0.0.1:5699/api/word/genshin
curl -X POST -F 'content=@/path/to/text.txt' -F 'mode=file' -F 'voice=0' -F 'noise_scale=0.6' -F 'noise_scale_w=0.667' -F 'rate=1' http://127.0.0.1:5699/api/word/genshin

响应结果

json
{ "status": "success", "msg": "ok" }
{ "status": "success", "msg": "ok" }

可选发音人

json
[
  { "id": 0, "label": "派蒙" },
  { "id": 1, "label": "凯亚" },
  { "id": 2, "label": "安柏" },
  { "id": 3, "label": "丽莎" },
  { "id": 4, "label": "琴" },
  { "id": 5, "label": "香菱" },
  { "id": 6, "label": "枫原万叶" },
  { "id": 7, "label": "迪卢克" },
  { "id": 8, "label": "温迪" },
  { "id": 9, "label": "可莉" },
  { "id": 10, "label": "早柚" },
  { "id": 11, "label": "托马" },
  { "id": 12, "label": "芭芭拉" },
  { "id": 13, "label": "优菈" },
  { "id": 14, "label": "云堇" },
  { "id": 15, "label": "钟离" },
  { "id": 16, "label": "魈" },
  { "id": 17, "label": "凝光" },
  { "id": 18, "label": "雷电将军" },
  { "id": 19, "label": "北斗" },
  { "id": 20, "label": "甘雨" },
  { "id": 21, "label": "七七" },
  { "id": 22, "label": "刻晴" },
  { "id": 23, "label": "神里绫华" },
  { "id": 24, "label": "戴因斯雷布" },
  { "id": 25, "label": "雷泽" },
  { "id": 26, "label": "神里绫人" },
  { "id": 27, "label": "罗莎莉亚" },
  { "id": 28, "label": "阿贝多" },
  { "id": 29, "label": "八重神子" },
  { "id": 30, "label": "宵宫" },
  { "id": 31, "label": "荒泷一斗" },
  { "id": 32, "label": "九条裟罗" },
  { "id": 33, "label": "夜兰" },
  { "id": 34, "label": "珊瑚宫心海" },
  { "id": 35, "label": "五郎" },
  { "id": 36, "label": "散兵" },
  { "id": 37, "label": "女士" },
  { "id": 38, "label": "达达利亚" },
  { "id": 39, "label": "莫娜" },
  { "id": 40, "label": "班尼特" },
  { "id": 41, "label": "申鹤" },
  { "id": 42, "label": "行秋" },
  { "id": 43, "label": "烟绯" },
  { "id": 44, "label": "久岐忍" },
  { "id": 45, "label": "辛焱" },
  { "id": 46, "label": "砂糖" },
  { "id": 47, "label": "胡桃" },
  { "id": 48, "label": "重云" },
  { "id": 49, "label": "菲谢尔" },
  { "id": 50, "label": "诺艾尔" },
  { "id": 51, "label": "迪奥娜" },
  { "id": 52, "label": "鹿野院平藏" }
]
[
  { "id": 0, "label": "派蒙" },
  { "id": 1, "label": "凯亚" },
  { "id": 2, "label": "安柏" },
  { "id": 3, "label": "丽莎" },
  { "id": 4, "label": "琴" },
  { "id": 5, "label": "香菱" },
  { "id": 6, "label": "枫原万叶" },
  { "id": 7, "label": "迪卢克" },
  { "id": 8, "label": "温迪" },
  { "id": 9, "label": "可莉" },
  { "id": 10, "label": "早柚" },
  { "id": 11, "label": "托马" },
  { "id": 12, "label": "芭芭拉" },
  { "id": 13, "label": "优菈" },
  { "id": 14, "label": "云堇" },
  { "id": 15, "label": "钟离" },
  { "id": 16, "label": "魈" },
  { "id": 17, "label": "凝光" },
  { "id": 18, "label": "雷电将军" },
  { "id": 19, "label": "北斗" },
  { "id": 20, "label": "甘雨" },
  { "id": 21, "label": "七七" },
  { "id": 22, "label": "刻晴" },
  { "id": 23, "label": "神里绫华" },
  { "id": 24, "label": "戴因斯雷布" },
  { "id": 25, "label": "雷泽" },
  { "id": 26, "label": "神里绫人" },
  { "id": 27, "label": "罗莎莉亚" },
  { "id": 28, "label": "阿贝多" },
  { "id": 29, "label": "八重神子" },
  { "id": 30, "label": "宵宫" },
  { "id": 31, "label": "荒泷一斗" },
  { "id": 32, "label": "九条裟罗" },
  { "id": 33, "label": "夜兰" },
  { "id": 34, "label": "珊瑚宫心海" },
  { "id": 35, "label": "五郎" },
  { "id": 36, "label": "散兵" },
  { "id": 37, "label": "女士" },
  { "id": 38, "label": "达达利亚" },
  { "id": 39, "label": "莫娜" },
  { "id": 40, "label": "班尼特" },
  { "id": 41, "label": "申鹤" },
  { "id": 42, "label": "行秋" },
  { "id": 43, "label": "烟绯" },
  { "id": 44, "label": "久岐忍" },
  { "id": 45, "label": "辛焱" },
  { "id": 46, "label": "砂糖" },
  { "id": 47, "label": "胡桃" },
  { "id": 48, "label": "重云" },
  { "id": 49, "label": "菲谢尔" },
  { "id": 50, "label": "诺艾尔" },
  { "id": 51, "label": "迪奥娜" },
  { "id": 52, "label": "鹿野院平藏" }
]

Powered by 小白兔AI