finds.dev

RustAudio/cpal

Low-level cross-platform audio I/O library in Rust

View on GitHub

★ 3,809RustApache-2.0updated Jun 2026

// the take

cpal is the foundational audio I/O layer for the Rust ecosystem — think PortAudio but Rust-native. It handles device enumeration and stream creation across every major platform, from WASAPI on Windows to AAudio on Android to Web Audio API in WASM. If you're building anything that produces or consumes audio in Rust, you either use this or you reinvent it badly.

Platform coverage is genuinely impressive: ALSA, WASAPI, CoreAudio, AAudio, PipeWire, PulseAudio, JACK, ASIO, and two WASM backends — each as a proper first-class implementation, not a thin shim. The ASIO path in particular is non-trivial and it's done right, including cross-compilation from Linux/macOS via MinGW. The `custom` backend feature lets you plug in your own host implementation, which is the correct escape hatch rather than forcing a fork. CI runs sanitizers and cross-platform matrix builds, which is the bar you'd expect for something this close to the metal.

No built-in audio format conversion or resampling — you get raw frames in whatever format the device wants, and bridging that to what your application needs is entirely your problem. The ALSA buffer size footgun (documented but still a footgun) means Linux newcomers will ship code that fast-forwards audio until they read far enough into the README. The PulseAudio backend requires Rust 1.88 while everything else targets 1.85, which is a silent MSRV trap if your project supports both. And the Android example lives in its own separate crate with its own build setup — useful as a reference but not something you'd ship as-is.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
3,809
Forks
513
Language
Rust
License
Apache-2.0
Last commit
11 Jun 2026

// nearby

If cpal isn't quite it.

All repos →