neteq/
lib.rs

1/*
2 * Copyright 2025 Security Union LLC
3 *
4 * Licensed under either of
5 *
6 * * Apache License, Version 2.0
7 *   (http://www.apache.org/licenses/LICENSE-2.0)
8 * * MIT license
9 *   (http://opensource.org/licenses/MIT)
10 *
11 * at your option.
12 *
13 * Unless you explicitly state otherwise, any contribution intentionally
14 * submitted for inclusion in the work by you, as defined in the Apache-2.0
15 * license, shall be dual licensed as above, without any additional terms or
16 * conditions.
17 */
18
19//! # Rust NetEQ
20//!
21//! A NetEQ-inspired adaptive jitter buffer implementation for audio decoding.
22//! This library provides functionality to handle network jitter, packet reordering,
23//! and adaptive buffering for real-time audio applications.
24
25pub mod buffer;
26pub mod codec;
27pub mod delay_manager;
28pub mod error;
29pub mod neteq;
30pub mod packet;
31pub mod signal;
32pub mod statistics;
33pub mod time_stretch;
34
35#[cfg(all(feature = "web", target_arch = "wasm32"))]
36pub mod web;
37
38pub use error::{NetEqError, Result};
39pub use neteq::{NetEq, NetEqConfig, NetEqStats, Operation};
40pub use packet::{AudioPacket, RtpHeader};
41
42#[cfg(all(feature = "web", target_arch = "wasm32"))]
43pub use web::WebNetEq;
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn basic_functionality() {
51        let config = NetEqConfig::default();
52        let neteq = NetEq::new(config).unwrap();
53
54        // Test basic operations
55        assert_eq!(neteq.target_delay_ms(), 0);
56        assert!(neteq.is_empty());
57    }
58}