diff --git a/packages/hms-video-store/src/media/settings/HMSAudioTrackSettings.ts b/packages/hms-video-store/src/media/settings/HMSAudioTrackSettings.ts index 95a3019caa..f49020741e 100644 --- a/packages/hms-video-store/src/media/settings/HMSAudioTrackSettings.ts +++ b/packages/hms-video-store/src/media/settings/HMSAudioTrackSettings.ts @@ -59,24 +59,6 @@ export class HMSAudioTrackSettingsBuilder { return this; } - updateConstraints(overrides: Partial>) { - const constraintsMap = new Map(); - this._advanced.forEach(constraint => { - const key = Object.keys(constraint)[0]; - constraintsMap.set(key, constraint); - }); - - Object.entries(overrides).forEach(([key, value]) => { - if (value !== undefined) { - // @ts-ignore - constraintsMap.set(key, { [key]: { exact: value['exact'] } }); - } - }); - - this._advanced = Array.from(constraintsMap.values()); - return this; - } - advanced(advanced: Array) { this._advanced = advanced; return this; diff --git a/packages/hms-video-store/src/plugins/audio/HMSAudioPluginsManager.ts b/packages/hms-video-store/src/plugins/audio/HMSAudioPluginsManager.ts index 097fc965f7..3b6b4c4f4b 100644 --- a/packages/hms-video-store/src/plugins/audio/HMSAudioPluginsManager.ts +++ b/packages/hms-video-store/src/plugins/audio/HMSAudioPluginsManager.ts @@ -91,7 +91,20 @@ export class HMSAudioPluginsManager { .codec(settings.codec) .maxBitrate(settings.maxBitrate) .deviceId(settings.deviceId!) - .updateConstraints([{ autoGainControl: { exact: false } }, { noiseSuppression: { exact: false } }]) + .advanced([ + // @ts-ignore + { googEchoCancellation: { exact: true } }, + // @ts-ignore + { googExperimentalEchoCancellation: { exact: true } }, + // @ts-ignore + { autoGainControl: { exact: false } }, + // @ts-ignore + { noiseSuppression: { exact: false } }, + // @ts-ignore + { googHighpassFilter: { exact: true } }, + // @ts-ignore + { googAudioMirroring: { exact: true } }, + ]) .audioMode(settings.audioMode) .build(); await this.hmsTrack.setSettings(newAudioTrackSettings); @@ -180,7 +193,20 @@ export class HMSAudioPluginsManager { .codec(settings.codec) .maxBitrate(settings.maxBitrate) .deviceId(settings.deviceId!) - .updateConstraints([{ autoGainControl: { exact: true } }, { noiseSuppression: { exact: true } }]) + .advanced([ + // @ts-ignore + { googEchoCancellation: { exact: true } }, + // @ts-ignore + { googExperimentalEchoCancellation: { exact: true } }, + // @ts-ignore + { autoGainControl: { exact: true } }, + // @ts-ignore + { noiseSuppression: { exact: true } }, + // @ts-ignore + { googHighpassFilter: { exact: true } }, + // @ts-ignore + { googAudioMirroring: { exact: true } }, + ]) .audioMode(settings.audioMode) .build(); await this.hmsTrack.setSettings(newAudioTrackSettings);