diff --git a/src/gateway/routes/settings.ts b/src/gateway/routes/settings.ts index ab15b5c..09dfd82 100644 --- a/src/gateway/routes/settings.ts +++ b/src/gateway/routes/settings.ts @@ -4,6 +4,8 @@ import path from 'path'; import { getConfig, ConfigManager } from '../../config/config.js'; import { resetProvider } from '../../providers/factory.js'; import { readUsageRows, summarize } from '../../providers/cost-estimate.js'; +import { isEngineReady } from '../../tools/voice-engine-client.js'; +import { buildSttHotwords } from '../../tools/stt-correct.js'; import { getClaudeSearchConfig, getClaudeSearchUsage } from '../../tools/claude-search.js'; // ── Helpers ────────────────────────────────────────────────────────────────── @@ -484,6 +486,15 @@ export function registerSettingsRoutes(app: Express): void { ttsSpeed: Math.min(1.4, Math.max(0.8, Number(e.ttsSpeed) || 1.15)), ttsVoice: voice, designedRefExists: voice !== 'clone' && fs.existsSync(designedRefPath(voice)), + info: { + online: (() => { try { return isEngineReady(); } catch { return false; } })(), + port: e.port || 8765, + sttModel: e.sttModel || 'medium', + device: e.device || 'cuda', + language: (cm.getConfig() as any).voice?.stt?.language || 'ko', + ttsModel: 'OmniVoice (k2-fsa/OmniVoice)', + hotwordCount: buildSttHotwords().split(/\s+/).filter(Boolean).length, + }, }); }); diff --git a/web-ui/html/index.html b/web-ui/html/index.html index 8567066..064c3d0 100644 --- a/web-ui/html/index.html +++ b/web-ui/html/index.html @@ -1892,35 +1892,11 @@
저장한 뒤 서버를 재시작하면 적용됩니다. 속도는 0.8~1.4배(1.5배 이상은 숫자·단위가 빠지는 것을 확인했습니다). 기본 외의 목소리는 처음 한 번 만든 기준 음성을 저장해 계속 같은 음색으로 읽습니다. 마음에 안 들면 "목소리 다시 뽑기" 후 재시작하세요.
-
- -
-
음성 인식 (STT)
- - - - - - -
- -
-
음성 합성 (TTS)
- - - - -
-
-
- + +
+
현재 사용 중
+
불러오는 중…
+
음성 인식과 합성은 모두 클로서버 GPU에서 로컬로 돌아가며, 음성 데이터는 외부로 나가지 않습니다. 인식 모델·장치는 config.json의 voice.engine에서 바꿉니다.
diff --git a/web-ui/js/app/settings-provider.js b/web-ui/js/app/settings-provider.js index 12689b1..cfe62c6 100644 --- a/web-ui/js/app/settings-provider.js +++ b/web-ui/js/app/settings-provider.js @@ -1226,16 +1226,7 @@ function toggleOrchAdvanced() { // ── Voice Settings ─────────────────────────────────────────────────────────── async function loadVoiceSettings() { - try { - const cfg = await api('/api/settings/voice'); - const v = (id, val) => { const el = document.getElementById(id); if (el && val !== undefined) el.value = val; }; - v('voice-stt-provider', cfg.stt?.provider); - v('voice-stt-model', cfg.stt?.model); - v('voice-stt-language', cfg.stt?.language); - v('voice-tts-provider', cfg.tts?.provider); - v('voice-tts-model', cfg.tts?.model); - } catch (e) { console.warn('loadVoiceSettings:', e); } - try { loadVoiceEngine(); } catch {} + try { loadVoiceEngine(); } catch (e) { console.warn('loadVoiceSettings:', e); } } // ── 실시간 음성 엔진: 낭독 속도·음성 종류 ────────────────────────────────────────── @@ -1256,10 +1247,26 @@ async function loadVoiceEngine() { const sp = document.getElementById('ve-speed'); sp.value = r.ttsSpeed; document.getElementById('ve-speed-val').textContent = Number(r.ttsSpeed).toFixed(2) + '배'; veVoiceChanged(); + renderVoiceEngineInfo(r); if (st) st.textContent = r.ttsVoice === 'clone' ? '' : (r.designedRefExists ? '기준 음성 저장됨' : '기준 음성은 다음 시작 때 만들어집니다'); } catch (e) { if (st) st.textContent = '불러오기 실패: ' + e.message; } } +function renderVoiceEngineInfo(r) { + const i = r.info || {}; + const row = (k, v) => '' + k + '' + v + ''; + const on = document.getElementById('ve-online'); + if (on) { on.textContent = i.online ? '● 실행 중' : '○ 꺼져 있음'; on.style.color = i.online ? 'var(--ok)' : 'var(--err)'; } + const t = document.getElementById('ve-info'); + if (t) t.innerHTML = [ + row('음성 인식 (STT)', 'Whisper ' + (i.sttModel || '-') + ' (faster-whisper, ' + (i.device || '-') + ') · 언어 ' + (i.language || 'ko')), + row('인식 보정', '핫워드 ' + (i.hotwordCount ?? 0) + '개 · 확신도 낮은 인식은 버림'), + row('음성 합성 (TTS)', '' + (i.ttsModel || '-') + ' (' + (i.device || '-') + ')'), + row('음성 종류 / 속도', (r.ttsVoice === 'clone' ? '기본 (등록된 목소리)' : r.ttsVoice) + ' · ' + Number(r.ttsSpeed).toFixed(2) + '배' + (i.runningSpeed ? '' : '')), + row('엔진 주소', '127.0.0.1:' + (i.port || '-')), + ].join(''); +} + async function saveVoiceEngine() { const st = document.getElementById('ve-status'); const sel = document.getElementById('ve-voice').value; @@ -1283,26 +1290,6 @@ async function rerollVoiceRef() { } catch (e) { if (st) st.textContent = '실패: ' + e.message; } } -async function saveVoiceSettings() { - const body = { - stt: { - provider: document.getElementById('voice-stt-provider')?.value, - model: document.getElementById('voice-stt-model')?.value?.trim(), - language: document.getElementById('voice-stt-language')?.value?.trim(), - }, - tts: { - provider: document.getElementById('voice-tts-provider')?.value, - model: document.getElementById('voice-tts-model')?.value?.trim(), - }, - }; - try { - await api('/api/settings/voice', { method: 'POST', body: JSON.stringify(body) }); - addProcessEntry('final', '음성 설정이 저장되었습니다.'); - } catch (err) { - addProcessEntry('error', '음성 설정 저장 실패: ' + err.message); - } -} - // ── Session Settings ───────────────────────────────────────────────────────── async function loadSessionSettings() {