Browse Source

Implement review changes 2

master
Mihai-Andrei Uscat 4 years ago
parent
commit
b53ad353cb
3 changed files with 23 additions and 16 deletions
  1. 6
    2
      config.js
  2. 1
    1
      react/features/base/config/configWhitelist.js
  3. 16
    13
      react/features/base/config/reducer.js

+ 6
- 2
config.js View File

@@ -125,8 +125,12 @@ var config = {
125 125
     // Enables support for opus-red (redundancy for Opus).
126 126
     // enableOpusRed: false,
127 127
 
128
-    // Enables HD audio quality (but also disables echo cancellation, noise suppression and AGC).
129
-    // enableHdAudio: false,
128
+    // Specify audio quality stereo and opusMaxAverageBitrate values, both necessary in order to enable HD audio.
129
+    // Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC.
130
+    // audioQuality: {
131
+    //     stereo: false,
132
+    //     opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range.
133
+    // }
130 134
 
131 135
     // Video
132 136
 

+ 1
- 1
react/features/base/config/configWhitelist.js View File

@@ -15,6 +15,7 @@ export default [
15 15
     'abTesting',
16 16
     'analytics.disabled',
17 17
     'audioLevelsInterval',
18
+    'audioQuality',
18 19
     'apiLogLevels',
19 20
     'avgRtpStatsN',
20 21
     'backgroundAlpha',
@@ -104,7 +105,6 @@ export default [
104 105
     'e2eping',
105 106
     'enableDisplayNameInStats',
106 107
     'enableEmailInStats',
107
-    'enableHdAudio',
108 108
     'enableIceRestart',
109 109
     'enableInsecureRoomNameWarning',
110 110
     'enableLayerSuspension',

+ 16
- 13
react/features/base/config/reducer.js View File

@@ -56,18 +56,6 @@ const INITIAL_RN_STATE = {
56 56
     }
57 57
 };
58 58
 
59
-/**
60
- * Options that enable stereo and HD audio if the {@code enableHdAudio} config option is set.
61
- */
62
-const hdAudioOptions = {
63
-    disableAP: true,
64
-    enableNoAudioDetection: false,
65
-    enableNoisyMicDetection: false,
66
-    enableTalkWhileMuted: false,
67
-    opusMaxAverageBitrate: 510000,
68
-    stereo: true
69
-};
70
-
71 59
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
72 60
     switch (action.type) {
73 61
     case UPDATE_CONFIG:
@@ -154,11 +142,26 @@ function _setConfig(state, { config }) {
154 142
 
155 143
     // eslint-disable-next-line no-param-reassign
156 144
     config = _translateLegacyConfig(config);
145
+    const hdAudioOptions = {};
146
+    const { audioQuality } = config;
147
+
148
+    if (audioQuality?.stereo && audioQuality?.opusMaxAverageBitrate) {
149
+        const { opusMaxAverageBitrate, stereo } = audioQuality;
150
+
151
+        Object.assign(hdAudioOptions, {
152
+            disableAP: true,
153
+            enableNoAudioDetection: false,
154
+            enableNoisyMicDetection: false,
155
+            enableTalkWhileMuted: false,
156
+            opusMaxAverageBitrate,
157
+            stereo
158
+        });
159
+    }
157 160
 
158 161
     const newState = _.merge(
159 162
         {},
160 163
         config,
161
-        config.enableHdAudio ? hdAudioOptions : {},
164
+        hdAudioOptions,
162 165
         { error: undefined },
163 166
 
164 167
         // The config of _getInitialState() is meant to override the config

Loading…
Cancel
Save