diff --git a/aec b/aec index f00bb1f..9e11f4f 160000 --- a/aec +++ b/aec @@ -1 +1 @@ -Subproject commit f00bb1fb948053c752b916adfee19f90644a0b2f +Subproject commit 9e11f4f95707714464194bdfc9db0222ec5c6163 diff --git a/src/bridge/featureBridge.js b/src/bridge/featureBridge.js index 422ba40..403da70 100644 --- a/src/bridge/featureBridge.js +++ b/src/bridge/featureBridge.js @@ -70,16 +70,16 @@ module.exports = { ipcMain.handle('stop-screen-capture', async () => askService.handleStopScreenCapture()); // Listen - ipcMain.handle('send-audio-content', async (event, { data, mimeType }) => await listenService.handleSendAudioContent(data, mimeType)); - ipcMain.handle('send-system-audio-content', async (event, { data, mimeType }) => { + ipcMain.handle('listen:sendMicAudio', async (event, { data, mimeType }) => await listenService.handleSendMicAudioContent(data, mimeType)); + ipcMain.handle('listen:sendSystemAudio', async (event, { data, mimeType }) => { const result = await listenService.sttService.sendSystemAudioContent(data, mimeType); if(result.success) { listenService.sendToRenderer('system-audio-data', { data }); } return result; }); - ipcMain.handle('start-macos-audio', async () => await listenService.handleStartMacosAudio()); - ipcMain.handle('stop-macos-audio', async () => await listenService.handleStopMacosAudio()); + ipcMain.handle('listen:startMacosSystemAudio', async () => await listenService.handleStartMacosAudio()); + ipcMain.handle('listen:stopMacosSystemAudio', async () => await listenService.handleStopMacosAudio()); ipcMain.handle('update-google-search-setting', async (event, enabled) => await listenService.handleUpdateGoogleSearchSetting(enabled)); ipcMain.handle('listen:changeSession', async (event, listenButtonText) => { console.log('[FeatureBridge] listen:changeSession from mainheader', listenButtonText); diff --git a/src/features/listen/listenService.js b/src/features/listen/listenService.js index 215210a..2137d57 100644 --- a/src/features/listen/listenService.js +++ b/src/features/listen/listenService.js @@ -205,8 +205,8 @@ class ListenService { } } - async sendAudioContent(data, mimeType) { - return await this.sttService.sendAudioContent(data, mimeType); + async sendMicAudioContent(data, mimeType) { + return await this.sttService.sendMicAudioContent(data, mimeType); } async startMacOSAudioCapture() { @@ -280,8 +280,8 @@ class ListenService { } // `_createHandler`를 사용하여 핸들러들을 동적으로 생성합니다. - handleSendAudioContent = this._createHandler( - this.sendAudioContent, + handleSendMicAudioContent = this._createHandler( + this.sendMicAudioContent, null, 'Error sending user audio:' ); diff --git a/src/features/listen/stt/sttService.js b/src/features/listen/stt/sttService.js index fb317e9..1e79bff 100644 --- a/src/features/listen/stt/sttService.js +++ b/src/features/listen/stt/sttService.js @@ -400,7 +400,7 @@ class SttService { return true; } - async sendAudioContent(data, mimeType) { + async sendMicAudioContent(data, mimeType) { // const provider = await this.getAiProvider(); // const isGemini = provider === 'gemini'; diff --git a/src/preload.js b/src/preload.js index 4cba484..f175060 100644 --- a/src/preload.js +++ b/src/preload.js @@ -271,10 +271,10 @@ contextBridge.exposeInMainWorld('api', { // src/ui/listen/audioCore/listenCapture.js listenCapture: { // Audio Management - sendAudioContent: (data) => ipcRenderer.invoke('send-audio-content', data), - sendSystemAudioContent: (data) => ipcRenderer.invoke('send-system-audio-content', data), - startMacosAudio: () => ipcRenderer.invoke('start-macos-audio'), - stopMacosAudio: () => ipcRenderer.invoke('stop-macos-audio'), + sendMicAudioContent: (data) => ipcRenderer.invoke('listen:sendMicAudio', data), + sendSystemAudioContent: (data) => ipcRenderer.invoke('listen:sendSystemAudio', data), + startMacosSystemAudio: () => ipcRenderer.invoke('listen:startMacosSystemAudio'), + stopMacosSystemAudio: () => ipcRenderer.invoke('listen:stopMacosSystemAudio'), // Screen Capture captureScreenshot: (options) => ipcRenderer.invoke('capture-screenshot', options), diff --git a/src/ui/listen/audioCore/listenCapture.js b/src/ui/listen/audioCore/listenCapture.js index 2f4a519..a114a57 100644 --- a/src/ui/listen/audioCore/listenCapture.js +++ b/src/ui/listen/audioCore/listenCapture.js @@ -335,7 +335,7 @@ async function setupMicProcessing(micStream) { const pcm16 = convertFloat32ToInt16(processedChunk); const b64 = arrayBufferToBase64(pcm16.buffer); - window.api.listenCapture.sendAudioContent({ + window.api.listenCapture.sendMicAudioContent({ data: b64, mimeType: 'audio/pcm;rate=24000', }); @@ -368,7 +368,7 @@ function setupLinuxMicProcessing(micStream) { const pcmData16 = convertFloat32ToInt16(chunk); const base64Data = arrayBufferToBase64(pcmData16.buffer); - await window.api.listenCapture.sendAudioContent({ + await window.api.listenCapture.sendMicAudioContent({ data: base64Data, mimeType: 'audio/pcm;rate=24000', }); @@ -517,15 +517,15 @@ async function startCapture(screenshotIntervalSeconds = 5, imageQuality = 'mediu console.log('Starting macOS capture with SystemAudioDump...'); // Start macOS audio capture - const audioResult = await window.api.listenCapture.startMacosAudio(); + const audioResult = await window.api.listenCapture.startMacosSystemAudio(); if (!audioResult.success) { console.warn('[listenCapture] macOS audio start failed:', audioResult.error); // 이미 실행 중 → stop 후 재시도 if (audioResult.error === 'already_running') { - await window.api.listenCapture.stopMacosAudio(); + await window.api.listenCapture.stopMacosSystemAudio(); await new Promise(r => setTimeout(r, 500)); - const retry = await window.api.listenCapture.startMacosAudio(); + const retry = await window.api.listenCapture.startMacosSystemAudio(); if (!retry.success) { throw new Error('Retry failed: ' + retry.error); } @@ -720,7 +720,7 @@ function stopCapture() { // Stop macOS audio capture if running if (isMacOS) { - window.api.listenCapture.stopMacosAudio().catch(err => { + window.api.listenCapture.stopMacosSystemAudio().catch(err => { console.error('Error stopping macOS audio:', err); }); }