#audio #sound #pcm #miniaudio

sys ep-miniaudio-sys

Raw bindings to the miniaudio C library

8 stable releases

✓ Uses Rust 2018 edition

new 2.0.1 Jul 6, 2020
1.2.0 Jun 29, 2020
1.1.3 Apr 20, 2020
0.1.0 Apr 4, 2020

#181 in Audio

Download history 25/week @ 2020-03-30 59/week @ 2020-04-06 40/week @ 2020-04-13 36/week @ 2020-04-20 7/week @ 2020-04-27 6/week @ 2020-05-04 13/week @ 2020-05-11 10/week @ 2020-05-18 12/week @ 2020-05-25 22/week @ 2020-06-01 13/week @ 2020-06-08 212/week @ 2020-06-15 40/week @ 2020-06-22 281/week @ 2020-06-29

250 downloads per month
Used in 2 crates (via miniaudio)

MIT license

420KB
380 lines

Mini Audio Rust Bindings

Build Status crates.io docs.rs

Bindings to https://github.com/dr-soft/miniaudio

** The crate currently lacks documentation, but for the most part the API is very close the the API of the miniaudio C library. That can be found in the C library's main header file. **

Building

LLVM must be installed in order to generate the bindings, but aside from that everything should just work. Feel free to open an issue here if that is not the case.

Example Usage

//! Enumerating Devices

use miniaudio::Context;

pub fn main() {
    let context = Context::new(&[], None).expect("failed to create context");

    context
        .with_devices(|playback_devices, capture_devices| {
            println!("Playback Devices:");
            for (idx, device) in playback_devices.iter().enumerate() {
                println!("\t{}: {}", idx, device.name());
            }

            println!("Capture Devices:");
            for (idx, device) in capture_devices.iter().enumerate() {
                println!("\t{}: {}", idx, device.name());
            }
        })
        .expect("failed to get devices");
}

Dependencies

~0–1.4MB
~31K SLoC