Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Implement review changes 2

Mihai-Andrei Uscatb53ad353cbe4
diff --git a/config.js b/config.js
index 6bb637585b..e1f8faaee0 100644
--- a/config.js
+++ b/config.js
@@ -125,8 +125,12 @@ var config = {
// Enables support for opus-red (redundancy for Opus).
// enableOpusRed: false,
- // Enables HD audio quality (but also disables echo cancellation, noise suppression and AGC).
- // enableHdAudio: false,
+ // Specify audio quality stereo and opusMaxAverageBitrate values, both necessary in order to enable HD audio.
+ // Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC.
+ // audioQuality: {
+ // stereo: false,
+ // opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range.
+ // }
// Video
diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js
index 17974b62a5..a8ad43ff1f 100644
--- a/react/features/base/config/configWhitelist.js
+++ b/react/features/base/config/configWhitelist.js
@@ -15,6 +15,7 @@ export default [
'abTesting',
'analytics.disabled',
'audioLevelsInterval',
+ 'audioQuality',
'apiLogLevels',
'avgRtpStatsN',
'backgroundAlpha',
@@ -104,7 +105,6 @@ export default [
'e2eping',
'enableDisplayNameInStats',
'enableEmailInStats',
- 'enableHdAudio',
'enableIceRestart',
'enableInsecureRoomNameWarning',
'enableLayerSuspension',
diff --git a/react/features/base/config/reducer.js b/react/features/base/config/reducer.js
index dbc1511397..75fda94c2d 100644
--- a/react/features/base/config/reducer.js
+++ b/react/features/base/config/reducer.js
@@ -56,18 +56,6 @@ const INITIAL_RN_STATE = {
}
};
-/**
- * Options that enable stereo and HD audio if the {@code enableHdAudio} config option is set.
- */
-const hdAudioOptions = {
- disableAP: true,
- enableNoAudioDetection: false,
- enableNoisyMicDetection: false,
- enableTalkWhileMuted: false,
- opusMaxAverageBitrate: 510000,
- stereo: true
-};
-
ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
switch (action.type) {
case UPDATE_CONFIG:
@@ -154,11 +142,26 @@ function _setConfig(state, { config }) {
// eslint-disable-next-line no-param-reassign
config = _translateLegacyConfig(config);
+ const hdAudioOptions = {};
+ const { audioQuality } = config;
+
+ if (audioQuality?.stereo && audioQuality?.opusMaxAverageBitrate) {
+ const { opusMaxAverageBitrate, stereo } = audioQuality;
+
+ Object.assign(hdAudioOptions, {
+ disableAP: true,
+ enableNoAudioDetection: false,
+ enableNoisyMicDetection: false,
+ enableTalkWhileMuted: false,
+ opusMaxAverageBitrate,
+ stereo
+ });
+ }
const newState = _.merge(
{},
config,
- config.enableHdAudio ? hdAudioOptions : {},
+ hdAudioOptions,
{ error: undefined },
// The config of _getInitialState() is meant to override the config