#cubeb

cubeb-core

Common types and definitions for cubeb rust and C bindings. Not intended for direct use.

15 unstable releases (5 breaking)

Uses old Rust 2015

0.9.0 Feb 17, 2021
0.8.0 Oct 6, 2020
0.7.0 Apr 30, 2020
0.6.2 Aug 22, 2019
0.5.0 Mar 22, 2018

#117 in Audio

Download history 44/week @ 2020-11-07 21/week @ 2020-11-14 34/week @ 2020-11-21 32/week @ 2020-11-28 50/week @ 2020-12-05 19/week @ 2020-12-12 12/week @ 2020-12-19 5/week @ 2020-12-26 19/week @ 2021-01-02 19/week @ 2021-01-09 17/week @ 2021-01-16 16/week @ 2021-01-23 8/week @ 2021-01-30 40/week @ 2021-02-06 97/week @ 2021-02-13 37/week @ 2021-02-20

97 downloads per month
Used in 2 crates

ISC license

2.5MB
48K SLoC

C++ 32K SLoC // 0.2% comments C 9K SLoC // 0.1% comments Python 3.5K SLoC // 0.4% comments Rust 2K SLoC // 0.1% comments Visual Studio Project 1K SLoC Automake 229 SLoC // 0.1% comments Visual Studio Solution 89 SLoC Shell 55 SLoC // 0.6% comments Xcode Config 32 SLoC // 0.7% comments

cubeb-rs ISC License

A cross-platform audio library in Rust.

Features

Provides access to the following:

  • Multiple audio backends across multiple platforms. See here for details.
  • Enumeration of available audio devices.
  • Opening input, output and duplex audio streams with control over latency, sample rate, channel layout, state transitions, data handling and more.

Goals

Currently, cubeb-rs is based on a set of bindings to the original cubeb C++ library most notable for its use as the audio backend within Gecko, Mozilla's browser engine. The long-term goal for cubeb-rs is to become independent of the C++ library and provide a pure-Rust implementation down to the level of the platform API eventually replacing the original within Gecko where possible.

In order to achieve this goal cubeb-rs is structured in a manner that supports backend implementations in both pure-Rust and via bindings to the C++ implementation, allowing for progressive replacement. So far, pure-Rust implementations exist for:

The plan is to consolidate all cubeb-related projects (including backend implementations) under a single repository here in the near future.

While cubeb is primarily renown for its use within Gecko, contributions and use from projects outside of Gecko is very welcome.

Crates

The following crates are included within this repository:

Crate Links Description
cubeb crates.io docs.rs The top-level user API for cubeb-rs. See the cubeb-api subdirectory. Depends on cubeb-core.
cubeb-core crates.io docs.rs Common types and definitions for cubeb rust and C bindings. Not intended for direct use. Depends on cubeb-sys.
cubeb-sys crates.io docs.rs Native bindings to the cubeb C++ library. Requires pkg-config and cmake
cubeb-backend crates.io docs.rs Bindings to libcubeb internals to facilitate implementing cubeb backends in Rust. Depends on cubeb-core.

Dependencies