whatisgithub

What is libopus-rs?

wavey-ai/libopus-rs — explained in plain English

Analysis updated 2026-05-18

0RustAudience · developerComplexity · 5/5LicenseSetup · moderate

In one sentence

A pure Rust rewrite of the Opus audio codec (libopus), currently supporting safe CELT-only encoding and decoding of raw audio frames.

Mindmap

mindmap
  root((repo))
    What it does
      Rust port of Opus codec
      CELT-only raw frames
      Safe Rust only
    Tech stack
      Rust
      Cargo
    Use cases
      Encode decode audio
      Benchmark vs C
      Codec research
    Audience
      Developers
      Audio engineers
    Status
      Work in progress
      No Ogg Opus yet
      No SILK mode

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Encode and decode 48 kHz audio using the CELT-only raw packet format in a Rust application.

USE CASE 2

Benchmark Rust audio codec performance against the original C libopus library.

USE CASE 3

Study or contribute to a from-scratch Rust port of a complex audio codec.

What is it built with?

Rust

How does it compare?

wavey-ai/libopus-rs404-agent/codes-minerbakome-hub/bakome-crypto-quant-engine
Stars000
LanguageRustRustRust
Setup difficultymoderatemoderateeasy
Complexity5/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Benchmarks against libopus need a built C reference via pkg-config or OPUS_DIR.

Free to use, modify, and distribute, including commercially, as long as you keep the copyright notice.

So what is it?

libopus-rs is a Rust rewrite of the libopus audio codec, version 1.5.2. Opus is a widely used audio compression format, and this project is not a wrapper that calls the original C library, it is an actual from-scratch implementation of the codec logic in Rust. The upstream C test suite is used as a reference to check the new code behaves the same way as the original. The project is still in progress. Right now it supports safe packet parsing, a repacketizer, soft clipping, and the core CELT encoding and decoding math needed for raw audio frames. CELT is the part of Opus designed for music and general audio at low latency. Using the Encoder and Decoder types included in the crate, developers can encode and decode 48 kHz audio in CELT-only mode with several frame lengths and bitrate control options. What is missing so far is support for Ogg Opus files and the SILK speech mode, so this is not yet a complete Opus implementation. The whole crate is written in safe Rust, using a compiler flag that forbids unsafe code, and it does not offer a C-compatible interface, so it cannot be used as a drop-in replacement for the original C library in software written in other languages. Two documentation files in the repository track progress: one lists the module-by-module porting plan and test status, and the other explains the project's policy on unsafe code. Developers can try it out with a command-line example called wav_celt, which encodes and decodes WAV audio files to test round-trip quality. The README also includes benchmark scripts that compare the Rust implementation's speed against the original C library, showing the Rust encoder currently runs faster in testing while the decoder runs slower. The maintainers are actively working on getting byte-for-byte compatibility with libopus output and list specific next steps for closing remaining gaps in the encoder. The project is licensed under BSD-3-Clause, the same license as the original libopus library.

Copy-paste prompts

Prompt 1
Show me how to use the wav_celt example in libopus-rs to round-trip a WAV file through CELT encoding.
Prompt 2
Explain what the CELT-only raw packet path in libopus-rs supports compared to full Opus.
Prompt 3
Help me set up the raw CELT benchmark script to compare libopus-rs against libopus.
Prompt 4
Walk me through the PORTING.md plan to understand what parts of Opus are not yet ported in libopus-rs.

Frequently asked questions

What is libopus-rs?

A pure Rust rewrite of the Opus audio codec (libopus), currently supporting safe CELT-only encoding and decoding of raw audio frames.

What language is libopus-rs written in?

Mainly Rust. The stack also includes Rust.

What license does libopus-rs use?

Free to use, modify, and distribute, including commercially, as long as you keep the copyright notice.

How hard is libopus-rs to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is libopus-rs for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.