Commit edaa5b9b by 李进峰

语音合成文档

parent 3254b195
- 基本地址
- 基本地址
- 测试环境: http://api-pre.heyqiwu.cn:9663
#### 获取不同声音的代号
URL: {基本地址}/api/speakers
METHOD: GET
Headers:
| key | value |
| :----------- | :------------: |
| Content-Type | application/json;charset=utf-8 |
ResponseBody:
```json
{
"online": { // 表示在线,对外暂时只用这里面的人物声音
"ProTencent17": { // key表示人物声音的编号
"name": "腾智美(客服女声(精品))", // 名称
"sex": "女", // 人物的性别
"mood": [
"正常" // 人物声音的情绪
],
"third_party": true // 是否是第三方的声音
}
}
}
```
Example:
```
curl --location --request GET 'http://api-pre.heyqiwu.cn:9663/api/speakers'
```
#### 合成语音
URL: {基本地址}/api/tts_ls
METHOD: GET
Headers:
| key | value |
| :----------- | :------------: |
| Content-Type | application/json;charset=utf-8 |
RequestBody:
```json
{
"botname": "12345678", // bot的帐号
"text_info_ls": [
{
"person": "ProTencent17", // 人物声音的编号
"tone":"正常", // 人物声音的情绪
"text": "你好,世界!" // 需要合成的文本
},
{
"person": "ProTencent17", // 人物声音的编号
"tone":"正常", // 人物声音的情绪
"text": "Hello World!" // 需要合成的文本
}
]
}
```
ResponseBody:
```json
{
"audio": [ // 返回的顺序和text_info_ls发送顺序一致
{
"url": "http://cdn-test.heyqiwu.cn/api/audio/cache/12345678/?filename=/12345678/ProTencent17/正常/5082079d92a8ef985f59e001d445ff20.mp3&exist=1" // 合成完成之后的地址
},
{
"url": "http://cdn-test.heyqiwu.cn/api/audio/cache/12345678/?filename=/12345678/ProTencent17/正常/ed076287532e86365e841e92bfc50d8c.mp3&exist=1" // 合成完成之后的地址
}
],
"status": 200 // 状态码,200表示成功,其他表示失败
}
```
Example:
```
curl --location --request POST 'http://api-pre.heyqiwu.cn:9663/api/tts_ls' \
--header 'Content-Type: application/json' \
--data-raw '{
"botname": "12345678",
"text_info_ls": [
{
"person": "ProTencent17",
"tone":"正常",
"text": "你好,世界!"
},
{
"person": "ProTencent17",
"tone":"正常",
"text": "Hello World!"
}
]
}'
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment