#ffi #opus #libopus

sys no-std opus-static-sys

Rust bindings to the reference Opus library (libopus)

5 stable releases

Uses new Rust 2024

1.5.2 Apr 1, 2025
1.0.1 Feb 18, 2025

#781 in Audio

Download history 105/week @ 2025-02-12 142/week @ 2025-02-19 9/week @ 2025-02-26 5/week @ 2025-03-12 1/week @ 2025-03-19 155/week @ 2025-03-26 203/week @ 2025-04-02 20/week @ 2025-04-09 18/week @ 2025-04-16 1/week @ 2025-04-23 4/week @ 2025-04-30

55 downloads per month
Used in 2 crates

MIT license

6MB
73K SLoC

C 53K SLoC // 0.2% comments Python 17K SLoC // 0.3% comments Shell 556 SLoC // 0.2% comments GNU Style Assembly 538 SLoC Automake 424 SLoC // 0.1% comments Rust 389 SLoC 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

About

opus-static-sys is an FFI Rust-binding to the reference Opus library libopus.

It uses bindgen to dynamically generate all Rust bindings and documentation, and will always compile a static version of the underlying Opus library to ensure cross-system capability without having to ensure that Opus is installed on the target system.

The library is fully no_std compatible and represents the minimal amount of overhead or glue code needed to utilize libopus within a Rust project.

Rust documentation can be found here, which corresponds directly to the libopus documentation.

Building

In order to use this crate, you will need cmake installed on your build computer. Most Linux-based operating systems provide this via the built-in package manager. It is available on MacOS from Homebrew. On Windows, it should have been installed by default when you installed the Visual Studio compiler.

Installation

To use, add the following to your Cargo.toml file:

[dependencies]
opus-static-sys = "1.5"

License

This library is licensed under the MIT license.

Dependencies