From 60f231157082664ddfc28c9c01eb95260ef197b6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 17 Mar 2025 10:03:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=87=E9=9B=86=E9=BA=A6?= =?UTF-8?q?=E5=85=8B=E9=A3=8E=E9=9F=B3=E9=87=8F=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StupWizard/index.tsx | 7 +++---- src/page/Meeting/index.tsx | 5 +++++ src/utils/package/agora.ts | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 4520f80..c707c76 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -245,7 +245,7 @@ const VideoComponents = () => { }, [darkLightEnhancement]); useEffect(() => { if (typeof virtualBackground.sourceIndex === 'number') { - window.electron.getEnv().then(res=>{ + window.electron.getEnv().then(res => { if (res === 'development') { window.electron.getAppPath().then((res: string) => { const imagePath = path.join(res, 'src', 'assets', 'virtualBackground', `${virtualBackground.sourceIndex + 1}.png`); @@ -730,9 +730,8 @@ const AudioComponents = () => { ecordingVolume: e, }) }} disabled={!audioDeviceManager.ecordingItem} /> - {/* || audioDeviceManager.autoEcordingVolume */} - {/*
+
{ setting.autoEcordingVolume = e.target.checked; storage.setItem('setting', JSON.stringify(setting)) @@ -741,7 +740,7 @@ const AudioComponents = () => { autoEcordingVolume: e.target.checked }) }} checked={audioDeviceManager.autoEcordingVolume}>自动调整麦克风音量 -
*/} +
{ diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index eff8d53..8e8b294 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1403,6 +1403,11 @@ const Meeting: React.FC = () => { const percentage = (item.volume / 255) * 100 if (domMe) { domMe.style.height = `${percentage}%` + if (item.volume > 180) { + agora.adjustRecordingSignalVolume(60) + } else { + agora.adjustRecordingSignalVolume(100) + } } window.electron.windowHandleMessage({ key: 'shareScreenWindow', diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 5783ed2..873ed77 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -591,4 +591,13 @@ export const agora = { greenCapacity: 1 }) }, + // 调节音频采集信号音量。 + adjustRecordingSignalVolume: async (number: number) => { + const setting = await JSON.parse(storage.getItem('setting') as string) + if (setting.autoEcordingVolume) { + await rtcEngine.adjustRecordingSignalVolume(number) + } else { + await rtcEngine.adjustRecordingSignalVolume(100) + } + } } \ No newline at end of file