Implement review changes 3

This commit is contained in:
Mihai-Andrei Uscat 2021-04-14 14:23:40 +03:00 committed by Saúl Ibarra Corretgé
parent b53ad353cb
commit 996c9fb064
2 changed files with 13 additions and 14 deletions

View File

@ -117,20 +117,15 @@ var config = {
// participants and to enable it back a reload is needed. // participants and to enable it back a reload is needed.
// startSilent: false // startSilent: false
// Sets the preferred target bitrate for the Opus audio codec by setting its
// 'maxaveragebitrate' parameter. Currently not available in p2p mode.
// Valid values are in the range 6000 to 510000
// opusMaxAverageBitrate: 20000,
// Enables support for opus-red (redundancy for Opus). // Enables support for opus-red (redundancy for Opus).
// enableOpusRed: false, // enableOpusRed: false,
// Specify audio quality stereo and opusMaxAverageBitrate values, both necessary in order to enable HD audio. // Specify audio quality stereo and opusMaxAverageBitrate values in order to enable HD audio.
// Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC. // Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC.
// audioQuality: { // audioQuality: {
// stereo: false, // stereo: false,
// opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range. // opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range.
// } // },
// Video // Video

View File

@ -142,19 +142,16 @@ function _setConfig(state, { config }) {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
config = _translateLegacyConfig(config); config = _translateLegacyConfig(config);
const hdAudioOptions = {};
const { audioQuality } = config; const { audioQuality } = config;
const hdAudioOptions = {};
if (audioQuality?.stereo && audioQuality?.opusMaxAverageBitrate) { if (audioQuality?.stereo) {
const { opusMaxAverageBitrate, stereo } = audioQuality;
Object.assign(hdAudioOptions, { Object.assign(hdAudioOptions, {
disableAP: true, disableAP: true,
enableNoAudioDetection: false, enableNoAudioDetection: false,
enableNoisyMicDetection: false, enableNoisyMicDetection: false,
enableTalkWhileMuted: false, enableTalkWhileMuted: false
opusMaxAverageBitrate,
stereo
}); });
} }
@ -231,6 +228,13 @@ function _translateLegacyConfig(oldValue: Object) {
newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS; newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
} }
if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
newValue.audioQuality = {
opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,
stereo: oldValue.audioQuality?.stereo ?? oldValue.stereo
};
}
return newValue; return newValue;
} }