feat(desktop): make local speech transcription work end to end
Local dictation had never produced a transcript on an installed build. The engine itself was healthy; every connection to it was broken. Installed builds shipped no speech engine at all: the packaging config had no entry for the faster-whisper sidecar and no pipeline step built one, so the app always fell back to a system Python without the runtime. Development was broken too, because the sidecar and SoX paths were resolved against the Vite output directory instead of the app root, which also meant recording failed with a SoX ENOENT. On hosts where localhost resolves only to IPv6, every local request was refused outright, which silently disabled both local transcription and the local LLM. The sidecar is now built and bundled (including the Silero VAD data it needs), gated by a packaging check that fails when the engine or its data is missing. Paths are discovered from the app root and fail loudly when the engine is absent. Local engine URLs are normalized to the IPv4 loopback, decoding is tuned so repeated hallucinations cannot compound (the same transcript now takes about a fifth of the time), the engine is warmed up at startup, and holding the hotkey now shows the text forming live in the recording tip.
This commit is contained in:
parent
359b244dc9
commit
2d585bfc29
52 changed files with 1450 additions and 3861 deletions
|
|
@ -1,5 +1,52 @@
|
|||
# D3RO-VOICE 프로젝트 현황
|
||||
|
||||
## v1.3.0 — 로컬 전사가 실제로 동작하게 (2026-09-18) 🎙️
|
||||
|
||||
설치본에서 로컬 전사가 **한 번도 성공한 적 없던** 원인을 끝까지 추적해 수정. 엔진 자체는
|
||||
정상이었고, 배선(경로/루프백/패키징)이 전부 어긋나 있었다.
|
||||
|
||||
**원인 (실측 근거)**
|
||||
1. **패키지에 사이드카가 없었다**: `electron-builder.yml` extraResources에 sidecar 항목이
|
||||
없었고 CIS도 PyInstaller 빌드를 하지 않았다. 설치본 `resources/`에는 icons/sounds/sox만
|
||||
존재 → 항상 faster-whisper 없는 시스템 Python으로 폴백 → 즉사.
|
||||
2. **dev 경로 해석 실패**: electron-vite는 `out/main/index.js`를 직접 띄워 `app.getAppPath()`가
|
||||
`apps/desktop/out/main`이 된다. 그래서 `out/main/sidecar/main.py`(없음) + 시스템 Python 3.14,
|
||||
SoX도 `spawn sox ENOENT`. 실제 venv(`apps/desktop/sidecar/.venv`, py3.11 + faster-whisper 1.2.1)는
|
||||
한 번도 사용되지 않았다.
|
||||
3. **localhost = ::1 only**: 이 호스트는 `localhost`가 IPv6로만 해석된다. 사이드카(uvicorn)와
|
||||
Ollama는 127.0.0.1에만 바인딩 → `http://localhost:...` 요청 전부 ECONNREFUSED. STT와 로컬 LLM이
|
||||
동시에 죽어 있었다.
|
||||
4. **VAD 데이터 누락**: faster-whisper의 `assets/silero_vad_v6.onnx`를 PyInstaller가 수집하지
|
||||
않아, 사이드카를 번들했더라도 VAD 사용 시 런타임 실패했을 것.
|
||||
5. **CAP-03(실시간 부분 전사)은 프로듀서가 없었다**: 채널/팝업/preload는 있는데 emit하는 코드가 0.
|
||||
|
||||
**수정**
|
||||
- `paths.ts`: 앱 루트를 마커(`sidecar/main.py`, `resources/sox`)로 탐색. 패키지 모드에서 사이드카가
|
||||
없으면 조용히 폴백하지 않고 즉시 실패(명확한 조치 안내).
|
||||
- `loopback.ts`: `localhost` → `127.0.0.1` 정규화 (LocalSTT/LocalLLM/RAG/OnlineLLM/STTManager,
|
||||
ConfigService 기본값). 단위 테스트 9개.
|
||||
- 패키징: extraResources에 `sidecar-dist/sidecar → resources/sidecar`, `resources/ffmpeg → ffmpeg`,
|
||||
ffmpeg는 `@ffmpeg-installer` 의존성 + asarUnpack. `setup-sidecar.mjs`/`build-sidecar.mjs` +
|
||||
`scripts/ci/verify-sidecar-bundle.mjs`(VAD onnx 존재 검증) → CI `package-windows/macos`에 추가.
|
||||
실측 번들: sidecar.exe 9.4MB + `_internal` 242MB, GPU 전사 왕복 성공.
|
||||
- 사이드카: 모델 재사용, `--collect-all faster_whisper`/`ctranslate2`, console 모드 유지(로그 수집) +
|
||||
spawn `windowsHide`, UTF-8 강제(PYTHONIOENCODING/`reconfigure`), 줄 단위 로그 파이프.
|
||||
- 성능/정합성: `condition_on_previous_text=False`, 온도 폴백 제한([0.0,0.2,0.4]),
|
||||
no_speech/compression/log_prob 임계, VAD `min_silence_duration_ms=300`, `cpu_threads` 8 상한.
|
||||
**7.7초 오디오: 1609ms → 303ms (약 5배)**, 전사문 동일.
|
||||
- 체감: 앱 시작 시 `warmUpLocal()`로 sidecar+모델 예열(bootstrap `stt-warmup`), 녹음 중 1.5초마다
|
||||
최근 7.5초 창 부분 전사 → RecordingTip 미리보기(삽입되지 않음, 최종 전사 전에 drain).
|
||||
|
||||
**검증**: typecheck 0, 변경 파일 lint 0, 신규 테스트 18개 GREEN(loopback 9 / paths 6 / STTManager 3 —
|
||||
기존 361건 실패는 better-sqlite3가 Electron ABI(130)로 빌드되어 Node 23(131)에서 로드 실패하는
|
||||
**선행 환경 문제**로 본 변경과 무관). 실제 사이드카 통합 테스트(실제 PCM 7.7초)로 최종 전사/부분
|
||||
전사 확인. electron-builder `--dir`로 패키지 산출물에 sidecar/_internal/VAD/ffmpeg/sox 존재 확인.
|
||||
|
||||
**미해결(외부)**: Windows 공개 서명(WIN_CSC_*)이 없어 로컬에서 서명된 설치본을 만들 수 없다 →
|
||||
`v1.3.0` 태그는 CI가 서명 게이트와 함께 빌드해야 한다(`11` GAP-REL-02).
|
||||
|
||||
---
|
||||
|
||||
## D3RO NAS Docker 클라우드 서비스 배포 체계 구축 (2026-08-19 /goal) 🚀
|
||||
|
||||
D3RO Voice의 클라우드 API 백엔드, AI 프록시, 관리자 백오피스(BackOffice)를 Synology, QNAP, Linux 등 NAS 환경에 Docker 컨테이너로 손쉽게 배포하고 운영할 수 있는 완전 자동화 인프라를 구축 완료.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue