feat(caption): let live captions use their own speech model

The speech engine now keeps an auxiliary model next to the dictation model
and transcribes with whichever the request names, reloading it once if the
engine restarted. Settings > STT gains a live-caption model so captions can
run on large-v3-turbo while dictation keeps its own model. The runtime
minimum rises to 1.7.0 because older engines would silently ignore the
model choice.

Suggestion paging moves to Up/Down: the page follows the selection and the
last item waits while more candidates are being generated. The Left/Right
page shortcuts are removed; they did nothing until a page had filled and
clash with Intel's display-rotation hotkeys.
This commit is contained in:
Yun Chan 2026-09-24 21:46:54 +09:00
parent 39b8e7448e
commit 4b0f685941
29 changed files with 222 additions and 234 deletions

View file

@ -75,6 +75,8 @@ class CaptionService extends EventEmitter {
private _systemTrack: StreamingCaptionTrack | null = null
/** 'auto' 언어일 때 첫 확정 결과로 고정한다 — 중간 결과마다 언어가 흔들리지 않게 */
private _sessionLanguage: string | null = null
/** 자막 전용 모델 (null 이면 받아쓰기 모델) */
private _captionModelId: string | null = null
private _refineQueue: CaptionSegment[] = []
private _refining = false
@ -126,6 +128,9 @@ class CaptionService extends EventEmitter {
// STT 초기화 (모델 로딩 — 시간 소요)
const sttService = getLocalSTTService()
await sttService.initialize()
// 자막 전용 모델을 골랐으면 받아쓰기 모델과 별도로 올려 둔다(보조 자리).
this._captionModelId = configGet('captionSttModelId') ?? null
if (this._captionModelId) await sttService.ensureAuxModel(this._captionModelId)
// 세션 초기화
this._sessionId = crypto.randomUUID()
@ -318,6 +323,7 @@ class CaptionService extends EventEmitter {
initialPrompt: opts.initialPrompt,
vadFilter: true,
partial: opts.partial,
modelId: this._captionModelId ?? undefined,
})
if (!opts.partial && configured === 'auto' && !this._sessionLanguage && result.text.trim() && result.language) {
this._sessionLanguage = result.language