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