Class RedundantAudioEncodedTransform

Implements RFC 2198 RED (Redundant Audio Data) encoding/decoding for Opus audio.

Sender: Encodes primary + redundant payloads to recover from packet loss. Receiver: Logs packets for loss/recovery statistics (does not decode RED).

Dynamically adjusts redundancy level (0-2 encodings) based on packet loss. Supports Opus FEC detection for recovery metrics calculation.

Hierarchy

  • default
    • RedundantAudioEncodedTransform

Constructors

Properties

shouldLog: boolean = true

Methods

  • Receiver transform: logs packets for loss/recovery stats without modifying frames.

    Parameters

    • frame: RTCEncodedAudioFrame
    • controller: TransformStreamDefaultController<RTCEncodedAudioFrame>

    Returns void

  • Receives encoded frames and modifies as needed before sending to transport.

    Parameters

    • frame: RTCEncodedAudioFrame
    • controller: TransformStreamDefaultController<RTCEncodedAudioFrame>

    Returns void

  • Not used directly - use senderTransform or receivePacketLogTransform.

    Parameters

    • _frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame
    • _controller: TransformStreamDefaultController<RTCEncodedAudioFrame | RTCEncodedVideoFrame>

    Returns void