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
     // Enables support for opus-red (redundancy for Opus).
125
     // Enables support for opus-red (redundancy for Opus).
126
     // enableOpusRed: false,
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
     // Video
135
     // Video
132
 
136
 

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

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

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

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
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
59
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
72
     switch (action.type) {
60
     switch (action.type) {
73
     case UPDATE_CONFIG:
61
     case UPDATE_CONFIG:
154
 
142
 
155
     // eslint-disable-next-line no-param-reassign
143
     // eslint-disable-next-line no-param-reassign
156
     config = _translateLegacyConfig(config);
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
     const newState = _.merge(
161
     const newState = _.merge(
159
         {},
162
         {},
160
         config,
163
         config,
161
-        config.enableHdAudio ? hdAudioOptions : {},
164
+        hdAudioOptions,
162
         { error: undefined },
165
         { error: undefined },
163
 
166
 
164
         // The config of _getInitialState() is meant to override the config
167
         // The config of _getInitialState() is meant to override the config

Loading…
Cancel
Save