olivebot/WebSocket.md
xszyou ec482dd31e 集成本地唇型算法
集成本地唇型算法
2023-06-17 00:14:12 +08:00

75 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 消息格式
通讯地址: [`ws://127.0.0.1:10002`](ws://127.0.0.1:10002)
ue作为客户端
### 发送情绪值
```json
{
"Topic": "Unreal",
"Data": {
"Key": "mood",
"Value": 1.0
}
}
```
| 参数 | 描述 | 类型 | 范围 |
| ---------- | ------ | ----- | ------- |
| Data.Value | 情绪值 | float | [-1, 1] |
### 发送音频
```json
{
"Topic": "Unreal",
"Data": {
"Key": "audio",
"Value": "C:\samples\sample-1.wav",
"Lips":[{"Lip": "sil", "Time": 180}, {"Lip": "FF", "Time": 144}],
"Time": 10,
"Type": "interact"
}
}
```
| 参数 | 描述 | 类型 | 范围 |
| ---------- | ---------------- | ----- | --------------- |
| Data.Value | 音频文件绝对路径 | str | |
| Data.Time | 音频时长 (秒) | float | |
| Data.Type | 发言类型 | str | interact/script |
| Data.Lips | 视音素 | array | |
### 发送回复文字
```json
{
"Topic": "Unreal",
"Data": {
"Key": "text",
"Value": "很高兴见到你"
}
}
```
| 参数 | 描述 | 类型 | 范围 |
| ---------- | ---------------- | ----- | --------------- |
| Data.text | 文本 | str | |