###删除bot缓存
#### Request
- URL:```/online_cache```
- METHOD:**DELETE**
- URL Parameters|TYPE: JSON
```
{
"botname":"作品标识"
}
```
#### Response
- ResponseBody:
```{"status":200,"message":"成功"}```
###获取所有角色离线上线信息
#### Request
- URL:```/api/speakers```
- METHOD:**GET**
#### Response
- ResponseBody:
```
{
"online": {
"A21": {
"name": "新新(男缓慢)",
"sex": "男",
"mood": [
"正常"
]
}
},
"offline": {
"B20_offline": {
"name": "李艺(女沉着)",
"sex": "女",
"mood": [
"正常",
"开心"
]
}
}
}
```
###根据请求信息返回文件或该文件的请求链接
#### Request
- URL:```/api/tts```
- METHOD:**GET|PUT|POST**
- URL Parameters|TYPE: JSON
```
{
"_type": "json",
"person": "A04_offline",
"tone": "正常",
"text": "好的。苏琪家好像是住北城,我家乡刚好在北城隔壁,顺路。",
"botname": "miao",
"pitch": 0.4,
"speed": 1.2,
"volume": 2.5,
"npcName": "xiaoming",
"get_online": false
}
```
- 参数说明:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|_type | false |string |返回音频文件URL| - | json |
|botname| false |string|作品标识| 中控 | - |
|person|false|string|语音人物标识|正常|-|
|tone|false|string|情绪|正常|-|
|text|true|string|文本内容|-|-|
|pitch|false|double|语调|0|-|
|speed|false|double|语速|1|-|
|volume|false|double|音量|0|-|
|npcName|false|string|代表优先寻找人工语音文件|-|-|
|get_online|false|boolean|代表只请求线上地址|true|-|
#### Response
- ResponseBody:
```{"status":200,"message":"成功","audio":"音频文件URL"}```
- 返回字段说明:该方法就是根据请求信息下载音频数据,生成.mp3文件,若_type是json则返回获取该生成后的.mp3文件的请求URL,否则返回该.mp3文件
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|message | false |string|返回信息|
|audio|false|string|音频文件URL|
###请求多个音频文件
#### Request
- URL:```/api/tts_ls```
- METHOD:**POST**
- URL Parameters|TYPE: JSON
```
{
"_type": "filename",
"platform": "xiaoai",
"botname": "miao",
"text_info_ls": [
{
"person": "A12_offline",
"tone": "正常",
"text": "用来进行测试的碰碰车不是小孩努力学习皮皮再将它皮皮 。",
"pitch": 0,
"speed": 1.3,
"volume": 0,
"npcName": "xiaoming"
}
]
}
```
- 参数说明:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|_type | false |string |获取b64文件名列表| - | filename |
|botname| false |string|作品标识| 中控 | - |
|platform| false |string| npc名称 | - | - |
|text_info_ls | true |arr| 请求信息列表 | -|-|
|person|false|string|语音人物标识|正常|-|
|tone|false|string|情绪|正常|-|
|text|true|string|文本内容|-|-|
|pitch|false|double|语调|0|-|
|speed|false|double|语速|1|-|
|volume|false|double|音量|0|-|
|npcName|false|string|代表优先寻找人工语音文件|-|-|
#### Response
- ResponseBody:
```{"status":200,"message":"成功","audio":"音频文件URL"}```
- 返回字段说明:若plateform为xiaoai则返回合并后的文件的请求URL;否则根据_type来选择返回的是b64文件内容列表或是b64文件名列表
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|message | false |string|返回信息|
|audio|false|string|音频文件URL|
###获取音频文件
#### Request
- URL:```/api/tts/get_audio```
- METHOD:**GET**
- URL Parameters:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|dirs| true |string|文件目录| - | - |
|filename| true |string| 文件名 | - | - |
|_type | false | String | 为file则可下载此文件 | - | - |
#### Response
- ResponseBody:
```{"status":200,"message":"成功"}```
- 返回字段说明
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|message | false |string|返回信息|
###上传单个音频
#### Request
- URL:```/api/upload/record/one_sen```
- METHOD:**POST**
- Headers:
- Content-Type: multipart/form-data
- 参数说明:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|tid | true |int |句子id| - | - |
|botName| true |string|作品账号名(非作品名)| - | - |
|npcName| true |string| npc名称 | - | - |
|text | true |string| 语音文件对应的句子 | - | - |
|file | true | file | 录音文件 | - | - |
#### Response
- 返回字段说明
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|msg | true |string|返回信息|
### 批量音频文件
#### Request
- Method: **POST**
- URL: ```/api/upload/record/one_npc```
- Headers:
- Content-Type: ```multipart/form-data```
- 参数说明:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|botName| true |string|作品账号名(非作品名)| - | - |
|npcName| true |string| npc名称 | - | - |
|file | true | file | 录音文件zip压缩包 | - | - |
#### Response
- 返回字段说明
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|msg | true |string|返回信息|
### 删除单个音频文件
#### Request
- Method: **DELETE**
- URL: ```/api/delete/record/one_sen```
- Headers:
- Content-Type: ```application/json```
- 参数说明:
|参数 |必选 |类型 |说明 |默认值 |参考值 |
|---- |---- |---- |---- |---- |---- |
|tid | true |int |句子id| - | - |
|botName| true |string|作品账号名(非作品名)| - | - |
|npcName| true |string| npc名称 | - | - |
|text | true |string| 语音文件对应的句子 | - | - |
#### Response
- 返回字段说明
|返回字段 |必有 |类型 | 说明 |
|---- |---- |---- |---- |
|status | true | int |返回状态|
|msg | true |string|返回信息|