#audio #sound

cpal

Low-level cross-platform audio playing library in pure Rust

55 releases

0.9.0 Jun 7, 2019
0.8.2 Jul 3, 2018
0.8.1 Apr 1, 2018
0.8.0 Feb 15, 2018
0.0.5 Dec 30, 2014

#9 in Audio

Download history 1012/week @ 2019-02-22 1355/week @ 2019-03-01 1313/week @ 2019-03-08 1335/week @ 2019-03-15 1382/week @ 2019-03-22 1447/week @ 2019-03-29 1246/week @ 2019-04-05 1806/week @ 2019-04-12 1737/week @ 2019-04-19 1519/week @ 2019-04-26 1534/week @ 2019-05-03 1907/week @ 2019-05-10 2937/week @ 2019-05-17 2682/week @ 2019-05-24 1735/week @ 2019-05-31

7,450 downloads per month
Used in 59 crates (17 directly)

Apache-2.0

181KB
3.5K SLoC

CPAL - Cross-Platform Audio Library

Build Status Crates.io docs.rs

Low-level library for audio input and output in pure Rust.

This library currently supports the following:

  • Enumerate all available audio devices.
  • Get the current default input and output devices.
  • Enumerate known supported input and output stream formats for a device.
  • Get the current default input and output stream formats for a device.
  • Build and run input and output PCM streams on a chosen device with a given stream format.

Currently supported backends include:

  • Linux (via ALSA)
  • Windows
  • macOS (via CoreAudio)
  • iOS (via CoreAudio)
  • Emscripten

Note that on Linux, the ALSA development files are required. These are provided as part of the libasound2-dev package on Debian and Ubuntu distributions and alsa-lib-devel on Fedora.

Dependencies

~1MB
~11K SLoC