| Crates.io | neteq |
| lib.rs | neteq |
| version | 0.6.1 |
| created_at | 2025-07-03 04:57:39.054126+00 |
| updated_at | 2025-09-24 02:35:01.206258+00 |
| description | NetEQ-inspired adaptive jitter buffer for audio decoding |
| homepage | https://github.com/security-union/videocall-rs |
| repository | https://github.com/security-union/videocall-rs |
| max_upload_size | |
| id | 1735813 |
| size | 391,315 |
Part of the videocall.rs real-time communication stack.
Project status: early preview – API is settling, performance tuning in progress.
Rust NetEQ is a pure-Rust, libWebRTC-inspired jitter buffer designed for professional, low-latency audio applications. It smooths out bursty networks, conceals packet loss, and keeps playback on time so that downstream DSP or audio renderers can focus on sound, not sockets.
no_std builds that provide an allocator.[dependencies]
neteq = "0.1"
Insert RTP payloads as they arrive, call get_audio() every 10 ms, and let the buffer handle the rest. Full runnable snippets live in the examples directory — open basic_usage.rs first.
[dependencies]
neteq = { version = "0.1", features = ["web"], default-features = false }
For browser environments, NetEq ships with:
neteq_worker) for off-main-thread audio processingWebNetEq wrapper with JavaScript bindings// Main thread: spawn NetEq worker
const worker = new Worker('/neteq_worker.js');
// Send Opus packets to worker
worker.postMessage({
cmd: 'insert',
seq: sequenceNumber,
timestamp: rtpTimestamp,
payload: opusPacketBytes
});
// Receive decoded PCM frames
worker.onmessage = (event) => {
if (event.data instanceof Float32Array) {
// 10ms of decoded audio ready for playback
audioWorklet.port.postMessage(event.data);
}
};
| Category | What you get |
|---|---|
| Delay management | Quantile-based estimator, exponential smoothing |
| Time-stretching | Accelerate • Pre-emptive Expand • Classical Expand |
| Buffer housekeeping | Age trimming • Overflow flush • Duplicate suppression |
| Statistics | Per-frame network & lifetime counters for observability |
| Configuration | Sample-rate aware, channel agnostic, compile-time feature flags |
| Web deployment | WebWorker binary • Embedded Opus decoder • Zero dependencies |
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AudioPacket │ │ PacketBuffer │ │ DelayManager │
│ │───▶│ │───▶│ │
│ • RTP Header │ │ • Ordered Queue │ │ • Adaptive │
│ • Audio Data │ │ • Duplicate Det │ │ • Statistics │
│ • Timestamps │ │ • Smart Flush │ │ • Target Delay │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ TimeStretching │ │ NetEQ │ │ Statistics │
│ │◀───│ │───▶│ │
│ • Accelerate │ │ • Decision │ │ • Network Stats │
│ • Preemptive │ │ • Decode │ │ • Lifetime │
│ • Expand │ │ • Control │ │ • Operations │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Each 10 ms tick NetEQ decides between Normal, Accelerate, Pre-emptive Expand, or Expand based on buffer fullness and arrival trends. Decisions and their rationale are exposed through the statistics API for post-analysis.
NetEq includes a complete web deployment solution with zero external dependencies:
neteq_worker binary runs NetEq off the main threadpostMessage()Float32Arrayopus-decoder.min.js - compiled at build time, no CDN requiredWhen you build with --features web, the Opus decoder JavaScript is embedded directly into the WASM binary using include_str!(). This means:
# Build NetEq worker for web deployment
cargo build --target wasm32-unknown-unknown --bin neteq_worker --features web --no-default-features
| Example | Highlights |
|---|---|
basic_usage.rs |
Minimal integration loop |
neteq_player.rs |
WAV replay with user-defined jitter & re-ordering knobs |
cargo run --release --example basic_usage
The videocall.rs project demonstrates production NetEq WebWorker usage:
Monitor NetEq performance in real-time with our interactive web dashboard. Track buffer health, network adaptation rates, and audio quality metrics.
📊 Complete Dashboard Setup Guide →

Key features:
Contributions are welcome — please skim the CONTRIBUTING.md first.
MIT OR Apache-2.0
This project is licensed under MIT OR Apache-2.0.
This NetEQ implementation is algorithmically inspired by and compatible with the WebRTC NetEQ jitter buffer. The original WebRTC project is:
This Rust implementation is an independent rewrite and is not a derivative work of the WebRTC source code.