自动采集麦克风音量大小
This commit is contained in:
parent
14e90cab7e
commit
60f2311570
|
|
@ -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 */}
|
||||
</div>
|
||||
{/* <div style={{ marginBottom: '10px' }}>
|
||||
<div style={{ marginBottom: '10px' }}>
|
||||
<Checkbox onChange={async (e) => {
|
||||
setting.autoEcordingVolume = e.target.checked;
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
|
|
@ -741,7 +740,7 @@ const AudioComponents = () => {
|
|||
autoEcordingVolume: e.target.checked
|
||||
})
|
||||
}} checked={audioDeviceManager.autoEcordingVolume}>自动调整麦克风音量</Checkbox>
|
||||
</div> */}
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<Checkbox checked={audioDeviceManager.isAINoiseReduction} onChange={(e) => {
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue