#audio-codec #opus #voice

opus-codec

Safe Rust bindings for the Opus audio codec

3 releases

Uses new Rust 2024

0.1.2 Dec 20, 2025
0.1.1 Dec 3, 2025
0.1.0 Dec 3, 2025

#1488 in Audio

MIT/Apache

6.5MB
74K SLoC

C 51K SLoC // 0.2% comments Python 16K SLoC // 0.3% comments Rust 4.5K SLoC // 0.0% comments GNU Style Assembly 538 SLoC Shell 532 SLoC // 0.3% comments Automake 418 SLoC // 0.1% comments Jupyter Notebooks 318 SLoC // 0.0% comments Perl 264 SLoC // 0.2% comments M4 199 SLoC // 0.3% comments Batch 14 SLoC // 0.1% comments

Contains (obscure autoconf code, 41KB) opus/configure.ac

opus-codec

Build Status Crates.io API reference MSRV License

Safe Rust wrappers around libopus for encoding/decoding Opus audio, with tests that validate core functionality against ffmpeg.

Features

  • presume-avx2: Build the bundled libopus with OPUS_X86_PRESUME_AVX2 on 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 with sh, wget, and tar, it is not supported on Windows.
  • system-lib: Link against a system-provided libopus instead of the bundled sources.

MSRV

Minimum Supported Rust Version (MSRV): 1.87.0.

License

This crate is licensed under either of

at your option.

Bundled libopus

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.

No runtime deps