feat: add SFX volume control and improve audio feedback
- Implemented separate sound effects volume control in settings. - Updated backend to handle new `sfx_volume` parameter. - Enhanced UI to include sound effects volume slider in admin panel. - Integrated sound effects for various user interactions (clicks, navigation, alerts). - Added a new global sound engine to manage audio synthesis without external files. - Updated documentation for Docker deployment and Windows packaging. - Refactored audio context management to ensure sound effects are available post user interaction.
This commit is contained in:
@@ -84,3 +84,32 @@ curl -X POST http://localhost:10085/api/display/command \
|
||||
- 大屏数据由后端模拟引擎产生(`sim_engine.py`,与原前端 `parkData.js` 逻辑一致);前端离线时也有本地兜底
|
||||
- 媒体文件存放于 `backend/media/`,`/file/...` 直接返回
|
||||
- 安全:`backend/.env` 与根 `.env.local` 已加入 `.gitignore`,含阿里云密钥与 MQTT 凭据,勿提交
|
||||
|
||||
|
||||
## Docker 部署(推荐)
|
||||
|
||||
一键构建并启动 **后端 + EMQX Broker**:
|
||||
|
||||
```bash
|
||||
# 1) (可选)配置部署参数
|
||||
export MQTT_PUBLIC_HOST=192.168.1.50 # 展播端可访问的服务器局域网 IP(Broker WebSocket)
|
||||
export EMQX_USER=dpmserver
|
||||
export EMQX_PASS=你的密码
|
||||
export DASHSCOPE_API_KEY=sk-xxx # AI/语音密钥(未配置时 AI 走本地规则引擎)
|
||||
export DPM_S2S_ENABLED=1 # 实时语音对话开关
|
||||
|
||||
# 2) 构建并启动
|
||||
docker compose up -d --build
|
||||
|
||||
# 3) 验证
|
||||
curl http://127.0.0.1:10085/api/health # {"ok":true,...}
|
||||
docker compose logs -f backend
|
||||
```
|
||||
|
||||
- 端口:`10085`(API/后台/媒体)、`8765`(s2s 语音)、`1883/8083/18083`(EMQX)
|
||||
- 数据卷:`dpm_media`(媒体)、`dpm_knowledge`(知识库 park.md,可热更新)、`dpm_data`(设置/播放列表)
|
||||
- 展播端(Tauri 大屏)启动时经 `GET /api/config` 自动获取 MQTT WebSocket 地址
|
||||
- 常用命令:`docker compose down` 停止;`docker compose up -d --build backend` 仅重建后端;
|
||||
`docker compose ps` 查看状态
|
||||
|
||||
> 单独构建镜像:`docker build -f backend/Dockerfile -t dpm-backend .`
|
||||
|
||||
Reference in New Issue
Block a user