Browse Source

Added setting Opus DTX in munged config for reduction in the audio traffic, when a participant is silent then the audio packet won’t be transmitted.

tags/v0.0.2
mbondarenko 3 years ago
parent
commit
ae22a37de5
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      modules/RTC/TraceablePeerConnection.js

+ 7
- 1
modules/RTC/TraceablePeerConnection.js View File

2267
 TraceablePeerConnection.prototype._mungeOpus = function(description) {
2267
 TraceablePeerConnection.prototype._mungeOpus = function(description) {
2268
     const { audioQuality } = this.options;
2268
     const { audioQuality } = this.options;
2269
 
2269
 
2270
-    if (!audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
2270
+    if (!audioQuality?.enableOpusDtx && !audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
2271
         return description;
2271
         return description;
2272
     }
2272
     }
2273
 
2273
 
2305
                 sdpChanged = true;
2305
                 sdpChanged = true;
2306
             }
2306
             }
2307
 
2307
 
2308
+            // On Firefox, the OpusDtx enablement has no effect
2309
+            if (!browser.isFirefox() && audioQuality?.enableOpusDtx) {
2310
+                fmtpConfig.usedtx = 1;
2311
+                sdpChanged = true;
2312
+            }
2313
+
2308
             if (!sdpChanged) {
2314
             if (!sdpChanged) {
2309
                 // eslint-disable-next-line no-continue
2315
                 // eslint-disable-next-line no-continue
2310
                 continue;
2316
                 continue;

Loading…
Cancel
Save