packet-loss

command
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package main demonstrates the two ways gopus recovers from a lost packet on a real (lossy) network: packet loss concealment and in-band forward error correction.

  • PLC (packet loss concealment): when a packet never arrives, call Decode(nil, pcm). The decoder synthesizes a replacement frame from its internal state, keeping the stream continuous instead of inserting a gap.

  • FEC (forward error correction): enabling in-band FEC lets the encoder include a low-bitrate copy (LBRR) of the previous audio. If frame N is lost, call DecodeWithFEC(packetN+1, pcm, true) to recover it from the next packet, then Decode(packetN+1, pcm) for that packet's primary audio. The decoder uses PLC when the packet has no usable redundancy.

This example selects a speech-oriented SILK stream and a nonzero expected loss percentage to encourage LBRR. Enabling FEC does not guarantee that every packet contains redundancy.

Usage:

go run ./examples/packet-loss

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL