change naming for featurebridge
This commit is contained in:
parent
9ec8df0548
commit
3c0654a0d4
2
aec
2
aec
@ -1 +1 @@
|
||||
Subproject commit f00bb1fb948053c752b916adfee19f90644a0b2f
|
||||
Subproject commit 9e11f4f95707714464194bdfc9db0222ec5c6163
|
@ -69,16 +69,16 @@ module.exports = {
|
||||
ipcMain.handle('ask:toggleAskButton', async () => await askService.toggleAskButton());
|
||||
|
||||
// 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);
|
||||
|
@ -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:'
|
||||
);
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user