packet-loss

command
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 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): when the encoder is configured with in-band FEC, each packet carries a low-bitrate copy (LBRR) of the PREVIOUS frame. If frame N is lost, the next packet (N+1) can reconstruct it: call DecodeWithFEC(packetN+1, pcm, true) to emit the recovered frame N, then Decode(packetN+1, pcm) to emit frame N+1 normally.

FEC needs a speech-oriented SILK stream (set up below) and a non-zero expected packet-loss percentage so the encoder spends bits on LBRR.

Usage:

go run ./examples/packet-loss

Jump to

Keyboard shortcuts

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