瀏覽代碼

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 年之前
父節點
當前提交
ae22a37de5
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7
    1
      modules/RTC/TraceablePeerConnection.js

+ 7
- 1
modules/RTC/TraceablePeerConnection.js 查看文件

@@ -2267,7 +2267,7 @@ TraceablePeerConnection.prototype._adjustRemoteMediaDirection = function(remoteD
2267 2267
 TraceablePeerConnection.prototype._mungeOpus = function(description) {
2268 2268
     const { audioQuality } = this.options;
2269 2269
 
2270
-    if (!audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
2270
+    if (!audioQuality?.enableOpusDtx && !audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
2271 2271
         return description;
2272 2272
     }
2273 2273
 
@@ -2305,6 +2305,12 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
2305 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 2314
             if (!sdpChanged) {
2309 2315
                 // eslint-disable-next-line no-continue
2310 2316
                 continue;

Loading…
取消
儲存