Skip to content

Commit f218236

Browse files
Disable red encoding by default for stereo track (#593)
* Disable red encoding by default for stereo track * changeset * prettier * Update src/room/track/options.ts Co-authored-by: David Zhao <[email protected]> * Update src/room/track/options.ts Co-authored-by: David Zhao <[email protected]> --------- Co-authored-by: David Zhao <[email protected]>
1 parent a3b74c8 commit f218236

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.changeset/four-snails-rescue.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'livekit-client': patch
3+
---
4+
5+
Disable red by default for stereo track

src/room/participant/LocalParticipant.ts

+6
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,13 @@ export default class LocalParticipant extends Participant {
439439
`Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.`,
440440
);
441441
}
442+
if (options.red === undefined) {
443+
log.info(
444+
`Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work.`,
445+
);
446+
}
442447
options.dtx ??= false;
448+
options.red ??= false;
443449
}
444450
const opts: TrackPublishOptions = {
445451
...this.roomOptions.publishDefaults,

src/room/track/options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ export interface TrackPublishDefaults {
2828
audioBitrate?: number;
2929

3030
/**
31-
* dtx (Discontinuous Transmission of audio), defaults to true
31+
* dtx (Discontinuous Transmission of audio), enabled by default for mono tracks.
3232
*/
3333
dtx?: boolean;
3434

3535
/**
36-
* red (Redundant Audio Data), defaults to true
36+
* red (Redundant Audio Data), enabled by default for mono tracks.
3737
*/
3838
red?: boolean;
3939

0 commit comments

Comments
 (0)