Safe Rust wrappers around libopus for encoding/decoding Opus audio, with tests that validate core functionality against ffmpeg.
presume-avx2: Build the bundled libopus withOPUS_X86_PRESUME_AVX2on x86/x86_64 targets, assuming AVX/AVX2/FMA support. Ignored when linking against a system libopus.dred: Enable libopus DRED support (downloads the model when building the bundled library). The bundled DRED build currently assumes a Unix-like host withsh,wget, andtar, it is not supported on Windows.system-lib: Link against a system-provided libopus instead of the bundled sources.
Minimum Supported Rust Version (MSRV): 1.87.0.
This crate is licensed under either of
at your option.
The upstream libopus sources are vendored via git subtree at tag v1.5.2 (split commit ddbe48383984d56acd9e1ab6a090c54ca6b735a6).
You can verify the copy is pristine by diffing opus/ against that upstream commit.
Bundled builds follow Cargo's selected C runtime automatically. By default, opus-codec builds the vendored libopus with the dynamic MSVC runtime. If you build with RUSTFLAGS="-C target-feature=+crt-static", the bundled libopus build switches to the static MSVC runtime as well.
If you enable the system-lib feature, opus-codec links against an already installed libopus instead of the vendored copy. In that case, the installed libopus must use the same CRT mode as the final binary.