full-river-57739
10/28/2025, 9:23 AMtall-airline-16756
10/28/2025, 9:23 AMtall-airline-16756
10/28/2025, 9:24 AMAudioTrackPublishOptions, where it’s enabled by default. While specific configuration details for other SDKs like JavaScript and Swift aren’t explicitly detailed, RED is confirmed as a core feature.
If you’d like more details about a specific SDK or egress scenario, please don’t hesitate to ask—I’m here to help! Sources: livekit-protocol/livekit/protocol/models.py | Codecs and more | LiveKit Docs | livekit-android-sdk/src/main/java/io/livekit/android/room/participant/Local... | CHANGELOG.md | LiveKit for Video Conferencingfull-river-57739
10/28/2025, 9:25 AMtall-airline-16756
10/28/2025, 9:26 AMNewPCMRemoteTrack function to read and decode remote audio tracks. This function thoughtfully manages RED decoding, jitter correction, and audio resampling for you. Here’s a simple example to get you started:
import (
media "github.com/livekit/media-sdk"
lkmedia "github.com/livekit/server-sdk-go/v2/pkg/media"
)
type PCM16Writer struct {
closed atomic.Bool
}
func (w *PCM16Writer) WriteSample(sample media.PCM16Sample) error {
if !w.closed.Load() {
// Use the decoded PCM16 samples from the remote track
}
}
func (w *PCM16Writer) Close() error {
w.closed.Store(true)
}
// Create a PCM remote track that automatically handles RED decoding
writer := &PCM16Writer{}
pcmTrack, err := lkmedia.NewPCMRemoteTrack(remoteTrack, writer)
if err != nil {
return err
}
This way, RED decoding is seamlessly handled without you needing to implement it manually. You’ll find similar support in other SDKs too, where RED decoding is built right into the framework.
If you’d like some tailored advice for a different SDK or have any special scenarios you’re working with, please don’t hesitate to reach out—I’m here to help! Sources: Codecs and more | LiveKit Docs | CHANGELOG.md | README.md | CHANGELOG.mdfull-river-57739
10/28/2025, 9:45 AMtall-airline-16756
10/28/2025, 9:46 AMRedReceiver in pkg/sfu/redreceiver.go is responsible for encoding RED payloads, while the RedPrimaryReceiver in pkg/sfu/redprimaryreceiver.go decodes them, helping to recover lost packets using redundant data.
• Receiver Management: In pkg/rtc/wrappedreceiver.go, RED plays a role in codec translation and keeps error correction intact during receiver setup and codec negotiation.
• Audio Configuration: The ActiveREDEncoding flag in pkg/sfu/receiver.go activates RED encoding for Opus tracks, and the REDTransformer interface manages RTP and RTCP transformations to support error correction.
• Testing: Tests in pkg/sfu/redreceiver_test.go ensure that packet loss recovery, out-of-order handling, and mixed codec scenarios are all properly handled.
These thoughtful implementations work together to provide strong error correction throughout the audio pipeline. If you'd like me to share specific code references or dive deeper into any part, just let me know—I’m here to help! Sources: pkg/rtc/wrappedreceiver.go | livekit-android-sdk/src/main/java/io/livekit/android/room/participant/Local... | lib/src/options.dart | Web Applications & Integration Examples | livekit/livekit_composite | DeepW...full-river-57739
10/28/2025, 10:58 AMtall-airline-16756
10/28/2025, 10:59 AMfull-river-57739
10/28/2025, 11:03 AMtall-airline-16756
10/28/2025, 11:05 AMRedReceiver is responsible for encoding RED payloads, while the RedPrimaryReceiver extracts and reconstructs audio from RED packets. This way, error correction happens smoothly on the server side, so the agents or SDKs receive audio streams that are already processed.
If you’d like me to explain more or dive into specific details about how the SFU handles RED, just let me know—I’m here to help! Sources: CHANGELOG.md | lib/src/options.dart | livekit-android-sdk/src/main/java/io/livekit/android/room/participant/Local... | Codecs and more | LiveKit Docsfull-river-57739
10/28/2025, 11:05 AMtall-airline-16756
10/28/2025, 11:07 AM