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.
// 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).
// 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.
// audioQuality: {
// stereo: false,
// opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range.
// }
// },
// Video

View File

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