fix: 오디오 테스트를 실시간 레벨 미터로 개선

단발성 평균값 → 100ms 간격 실시간 RMS 스트리밍.
AudioCaptureService 직접 시작/5초 자동 중지.
테스트 버튼 누르면 레벨 바가 왔다갔다 반응.
This commit is contained in:
Yun Chan 2026-04-08 09:07:29 +09:00
parent 7a925bdeb9
commit 6197ceb132
3 changed files with 70 additions and 15 deletions

View file

@ -539,18 +539,15 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac
setMicLevel(0)
} else {
setMicTesting(true)
setMicLevel(0.05)
const resp = await window.electronAPI.audio.testDevice({ deviceId: 'default' })
if (resp.success) {
setMicLevel(resp.data.averageLevel)
setTimeout(() => {
setMicLevel(0)
const unsub = window.electronAPI.audio.onTestLevel((e) => {
setMicLevel(e.level)
if (e.level === 0) {
setMicTesting(false)
setMicLevel(0)
}, 3000)
} else {
setMicTesting(false)
setMicLevel(0)
}
unsub()
}
})
await window.electronAPI.audio.testDevice({ deviceId: 'default' })
}
}}
sx={{ fontFamily: d3roFontMono, fontSize: '11px', minWidth: 80 }}