// the find
RustAudio/cpal
Low-level cross-platform audio I/O library in Rust
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.