feat: 集成本地语音系统 - SenseVoice 识别 + MeloTTS 中文合成

- whisper_server.py 支持 --engine sensevoice(复用 VAD/幻觉过滤,默认 whisper 兼容)
- 新增 /voice/local WS 通道 + local-asr.js 会话层(懒启动、pending 队列、flush 补发)
- manager.js 复活:py -3 探测(Store 占位符兜底)、模型路径双模式解析、ensure/waitForVoiceReady
- 新增 tts_melo.py + melo TTS provider(MeloTTS 中文,免费离线,lexicon 音素化无需 espeak-ng)
- api.js 修复 ws 8.x isBinary 帧区分(文本/二进制都以 Buffer emit,云端 ASR flush 误判为音频的隐藏 bug)
- 语音面板默认本地引擎;TTS 下拉新增 MeloTTS;/tts/stream 按 provider 输出 audio/wav
- 模型目录 src/voice/models/ gitignored,打包时经 asarUnpack 进安装包(391MB)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-08 03:08:15 +08:00
parent bd29375cf3
commit 91a161179d
11 changed files with 493 additions and 37 deletions

2
.gitignore vendored
View File

@@ -153,3 +153,5 @@ images/demo.mp4
images/demo.gif
images/UI.gif
music/HedwigsTheme.mp3
src/voice/models/
__pycache__/