fix: 설정 오디오 테스트 버튼 실제 동작 연결

voice.onAudioLevel 구독(실제 캡처 없음) → audio.testDevice 호출로 변경.
2초 캡처 후 실제 RMS 레벨을 레벨 바에 표시.
This commit is contained in:
Yun Chan 2026-04-08 09:05:36 +09:00
parent fa73ad3bb2
commit 7a925bdeb9

View file

@ -533,20 +533,24 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac
<Button <Button
variant={micTesting ? 'contained' : 'outlined'} variant={micTesting ? 'contained' : 'outlined'}
size="small" size="small"
onClick={() => { onClick={async () => {
if (micTesting) { if (micTesting) {
setMicTesting(false) setMicTesting(false)
setMicLevel(0) setMicLevel(0)
} else { } else {
setMicTesting(true) setMicTesting(true)
const unsub = window.electronAPI.voice.onAudioLevel((e) => { setMicLevel(0.05)
setMicLevel(e.level) const resp = await window.electronAPI.audio.testDevice({ deviceId: 'default' })
}) if (resp.success) {
setMicLevel(resp.data.averageLevel)
setTimeout(() => { setTimeout(() => {
setMicTesting(false) setMicTesting(false)
setMicLevel(0) setMicLevel(0)
unsub() }, 3000)
}, 5000) } else {
setMicTesting(false)
setMicLevel(0)
}
} }
}} }}
sx={{ fontFamily: d3roFontMono, fontSize: '11px', minWidth: 80 }} sx={{ fontFamily: d3roFontMono, fontSize: '11px', minWidth: 80 }}