fix: 회의 모드 마이크 캡처 강제 — ConfigService 레벨에서 오디오 소스 변경
CaptionService.start()가 ConfigService에서 captionAudioSource를 다시 읽어 setConfig 호출이 무시되는 문제 수정. ConfigService 값을 임시 변경 후 복원.
This commit is contained in:
parent
43a2acb89d
commit
2a465f22e9
1 changed files with 14 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ import fs from 'fs'
|
||||||
import { nanoid } from 'nanoid'
|
import { nanoid } from 'nanoid'
|
||||||
import { eq, desc, sql } from 'drizzle-orm'
|
import { eq, desc, sql } from 'drizzle-orm'
|
||||||
import { getLogger } from './LoggerService'
|
import { getLogger } from './LoggerService'
|
||||||
import { configGet } from './ConfigService'
|
import { configGet, configSet } from './ConfigService'
|
||||||
import { getMainWindow } from '../windows/WindowManager'
|
import { getMainWindow } from '../windows/WindowManager'
|
||||||
import { getDatabase } from '../db'
|
import { getDatabase } from '../db'
|
||||||
import { meetingSessions, meetingMemos } from '../db/schema'
|
import { meetingSessions, meetingMemos } from '../db/schema'
|
||||||
|
|
@ -151,18 +151,26 @@ class MeetingModeService extends EventEmitter {
|
||||||
}
|
}
|
||||||
captionService.on('segment', this._segmentHandler)
|
captionService.on('segment', this._segmentHandler)
|
||||||
|
|
||||||
// 회의 모드는 마이크 캡처 강제 (시스템 오디오가 아닌 마이크)
|
// 회의 모드는 마이크 캡처 강제 — ConfigService 값도 임시 변경
|
||||||
const prevAudioSource = captionService.getConfig().audioSource
|
// (CaptionService.start()가 ConfigService에서 다시 읽기 때문)
|
||||||
captionService.setConfig({ audioSource: 'mic' })
|
type AppConfigKey = keyof import('@shared/types').AppConfig
|
||||||
|
const prevAudioSource = configGet('captionAudioSource' as AppConfigKey) as unknown as string
|
||||||
|
configSet('captionAudioSource' as AppConfigKey, 'mic' as never)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await captionService.start()
|
await captionService.start()
|
||||||
// 회의 모드 UI가 자체 자막 패널에 표시하므로 오버레이 숨김
|
// 회의 모드 UI가 자체 자막 패널에 표시하므로 오버레이 숨김
|
||||||
const { hideCaptionOverlay } = await import('../windows/WindowManager')
|
const { hideCaptionOverlay } = await import('../windows/WindowManager')
|
||||||
hideCaptionOverlay()
|
hideCaptionOverlay()
|
||||||
|
// ConfigService 원래 값 복원
|
||||||
|
if (prevAudioSource) {
|
||||||
|
configSet('captionAudioSource' as AppConfigKey, prevAudioSource as never)
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 오디오 소스 복원
|
// ConfigService 원래 값 복원
|
||||||
captionService.setConfig({ audioSource: prevAudioSource })
|
if (prevAudioSource) {
|
||||||
|
configSet('captionAudioSource' as AppConfigKey, prevAudioSource as never)
|
||||||
|
}
|
||||||
// 시작 실패 시 복원
|
// 시작 실패 시 복원
|
||||||
captionService.off('segment', this._segmentHandler)
|
captionService.off('segment', this._segmentHandler)
|
||||||
this._segmentHandler = null
|
this._segmentHandler = null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue