#ffi #libopus #opus #bindings #libopusenc

sys no-std libopusenc-static-sys

Rust bindings to the reference Opus Encoder library (libopusenc)

3 stable releases

Uses new Rust 2024

1.0.3 Apr 1, 2025
1.0.1 Feb 18, 2025

#1105 in Audio

Download history 211/week @ 2025-02-17 21/week @ 2025-02-24 6/week @ 2025-03-03 110/week @ 2025-03-31 18/week @ 2025-04-07 4/week @ 2025-04-14 1/week @ 2025-04-21

133 downloads per month
Used in libopusenc

MIT license

180KB
4K SLoC

C 3K SLoC // 0.1% comments Rust 282 SLoC M4 225 SLoC // 0.2% comments Visual Studio Project 172 SLoC Automake 88 SLoC // 0.2% comments Visual Studio Solution 43 SLoC Batch 20 SLoC Shell 5 SLoC // 0.3% comments

Contains (obscure autoconf code, 6KB) libopusenc/configure.ac

About

libopusenc-static-sys is an FFI Rust-binding to the reference Opus Encoder library libopusenc.

It uses bindgen to dynamically generate all Rust bindings and documentation, and will always compile a static version of the underlying Opus Encoder 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 libopusenc within a Rust project.

Rust documentation can be found here, which corresponds directly to the libopusenc 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]
libopusenc-static-sys = "1.0"

License

This library is licensed under the MIT license.

Dependencies

~6.5MB
~79K SLoC