Translate README to Chinese

This commit is contained in:
Xulilong 2026-07-15 17:07:48 +08:00
parent 483486ee23
commit a7e52b4b2d

132
README.md
View File

@ -1,89 +1,86 @@
# SmartMeeting # SmartMeeting 智能会议
SmartMeeting is a Docker Compose deployment for Speakr, FunASR Paraformer ASR, 这是一个基于 Docker Compose 的智能会议部署项目,包含 Speakr 前后端、Paraformer ASR、声纹向量提取服务以及实时 WebSocket 转写桥接服务。
speaker embedding extraction, and the realtime WebSocket bridge.
## Directory Layout ## 目录结构
```text ```text
/storage01/home/xll/202607/voice /storage01/home/xll/202607/voice
├── docker-compose.yml # Main Compose file ├── docker-compose.yml # 统一启动文件
├── config.env # Runtime configuration to edit ├── config.env # 运行环境变量,主要改这里
├── asr/main.py # ASR adapter service code ├── asr/main.py # ASR 适配服务代码
├── speakr/ # Speakr frontend/backend code ├── speakr/ # Speakr 前后端代码
├── voice-dected/ # Speaker embedding service code ├── voice-dected/ # 声纹向量提取服务代码
├── fastapi_wss/ # Realtime WebSocket bridge code ├── fastapi_wss/ # 实时 WebSocket 桥接服务代码
└── deploy/data/ # Runtime data, ignored by git └── deploy/data/ # 运行数据,已被 git 忽略
``` ```
## Start And Stop ## 启动和停止
Run all services: 启动全部服务:
```bash ```bash
cd /storage01/home/xll/202607/voice cd /storage01/home/xll/202607/voice
docker compose up -d docker compose up -d
``` ```
Check status and logs: 查看状态和日志:
```bash ```bash
docker compose ps docker compose ps
docker compose logs -f docker compose logs -f
``` ```
Stop services: 停止服务:
```bash ```bash
docker compose down docker compose down
``` ```
## Services And Ports ## 服务和端口
| Service | Container | Port | Purpose | | 服务 | 容器名 | 端口 | 作用 |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Speakr | `voice-speakr` | `8899` | Web UI and backend | | Speakr | `voice-speakr` | `8899` | 页面和后端 |
| ASR | `asr-test` | `59805` | Paraformer HTTP and WebSocket ASR | | ASR | `asr-test` | `59805` | Paraformer HTTP / WebSocket 识别 |
| Speaker embedding | `voice-dected` | `18000` | `/extract_embedding` voiceprint service | | 声纹提取 | `voice-dected` | `18000` | `/extract_embedding` 声纹向量服务 |
| Realtime bridge | `fastapi-wss` | `10095` | Browser realtime ASR WebSocket bridge | | 实时桥接 | `fastapi-wss` | `10095` | 页面实时 ASR WebSocket 桥接 |
| Redis | `voice-redis` | `16380` | Cache/session storage for realtime bridge | | Redis | `voice-redis` | `16380` | 实时桥接的缓存/会话存储 |
Main access URL: 页面访问地址:
```text ```text
http://192.168.0.46:8899/tool/speakr/ http://192.168.0.46:8899/tool/speakr/
``` ```
For browser microphone recording, use a secure context. The quickest local 浏览器麦克风录音需要安全上下文。局域网 IP 的 HTTP 页面可能无法调用麦克风。最快的本机访问方式是开 SSH 隧道:
workaround is an SSH tunnel:
```bash ```bash
ssh -L 8899:127.0.0.1:8899 xll@192.168.0.46 ssh -L 8899:127.0.0.1:8899 xll@192.168.0.46
``` ```
Then open: 然后浏览器打开:
```text ```text
http://localhost:8899/tool/speakr/ http://localhost:8899/tool/speakr/
``` ```
## Configuration ## 配置文件
Most runtime settings are in: 主要修改这个文件:
```text ```text
/storage01/home/xll/202607/voice/config.env /storage01/home/xll/202607/voice/config.env
``` ```
Edit this file first when changing service addresses, model endpoints, LLM 改服务地址、模型地址、LLM 配置、声纹匹配阈值时,优先改 `config.env`。修改后执行:
settings, or speaker matching behavior. After editing:
```bash ```bash
cd /storage01/home/xll/202607/voice cd /storage01/home/xll/202607/voice
docker compose up -d docker compose up -d
``` ```
Important variables: 重要变量:
```env ```env
ASR_BASE_URL=http://asr-test:59805 ASR_BASE_URL=http://asr-test:59805
@ -100,37 +97,34 @@ VOICEPRINT_STORE=/data/asr_voiceprints.json
VOICEPRINT_MATCH_THRESHOLD=0.45 VOICEPRINT_MATCH_THRESHOLD=0.45
``` ```
Notes: 说明:
- Inside Docker Compose, use service names such as `asr-test`, - Compose 内部服务互相访问时,用 `asr-test``voice-dected``redis` 这种服务名。
`voice-dected`, and `redis`. - 宿主机或外部机器访问时,用 `192.168.0.46:59805``192.168.0.46:18000``192.168.0.46:10095` 这种宿主机端口。
- From outside Docker, use host ports such as `192.168.0.46:59805`, - `VOICEPRINT_MATCH_THRESHOLD` 是声纹匹配阈值。值越低越容易匹配,值越高越不容易误匹配。
`192.168.0.46:18000`, and `192.168.0.46:10095`.
- `VOICEPRINT_MATCH_THRESHOLD` controls how strict speaker matching is.
Lower values match more easily; higher values reduce false matches.
## Runtime Data ## 运行数据
Runtime data is stored under: 运行数据放在:
```text ```text
/storage01/home/xll/202607/voice/deploy/data/ /storage01/home/xll/202607/voice/deploy/data/
``` ```
Important subdirectories: 常见子目录:
```text ```text
deploy/data/speakr/uploads/ # Uploaded/recorded audio deploy/data/speakr/uploads/ # 上传和录音文件
deploy/data/speakr/instance/ # Speakr SQLite database deploy/data/speakr/instance/ # Speakr SQLite 数据库
deploy/data/asr/ # ASR voiceprint store deploy/data/asr/ # ASR 声纹库
deploy/data/redis/ # Redis persistence deploy/data/redis/ # Redis 持久化数据
``` ```
These files are ignored by git. 这些运行数据已被 `.gitignore` 忽略,不会提交到仓库。
## Voiceprint Flow ## 声纹流程
Speakr calls the ASR adapter for voiceprint platform compatibility: Speakr 声纹管理页面会调用 ASR 适配层的兼容接口:
```text ```text
POST /voice_insert POST /voice_insert
@ -138,25 +132,37 @@ GET /get_voice_name
DELETE /delete_voice DELETE /delete_voice
``` ```
The ASR adapter stores embeddings in: ASR 适配层会把声纹向量保存到:
```text ```text
deploy/data/asr/asr_voiceprints.json deploy/data/asr/asr_voiceprints.json
``` ```
During `/asr` transcription, the adapter converts uploaded audio to 16 kHz mono 转录时,`/asr` 会先把上传音频转成 `16k 单声道 wav`,再调用 `voice-dected` 提取声纹向量,并和已录入声纹做相似度匹配。如果分数超过 `VOICEPRINT_MATCH_THRESHOLD`,返回匹配到的说话人名称。
WAV, calls `voice-dected`, compares the embedding with stored voiceprints, and
returns a matched speaker name when the similarity passes the threshold.
## Useful Checks 目前这个逻辑是“整段音频匹配一个最像的人”。如果一段录音里多人轮流说话,还需要进一步接入分段说话人识别。
## 常用检查命令
检查 ASR
```bash ```bash
curl http://127.0.0.1:59805/health curl http://127.0.0.1:59805/health
```
检查声纹列表:
```bash
curl http://127.0.0.1:59805/get_voice_name curl http://127.0.0.1:59805/get_voice_name
```
检查 Speakr 配置:
```bash
curl http://127.0.0.1:8899/tool/speakr/api/config curl http://127.0.0.1:8899/tool/speakr/api/config
``` ```
WebSocket check: 检查实时 WebSocket 链路:
```bash ```bash
docker exec -it fastapi-wss python - <<'PY' docker exec -it fastapi-wss python - <<'PY'
@ -171,3 +177,21 @@ async def main():
asyncio.run(main()) asyncio.run(main())
PY PY
``` ```
## Git 操作
仓库地址:
```text
https://gitea.zkzdht.com/Ascend/SmartMeeting.git
```
常用命令:
```bash
cd /storage01/home/xll/202607/voice
git status
git add .
git commit -m "更新说明"
git push
```