miniaudio

Crates.iominiaudio
lib.rsminiaudio
version0.10.0
sourcesrc
created_at2020-04-04 20:39:26.810681
updated_at2020-07-23 19:53:47.963209
descriptionBindings to the miniaudio C library.
homepagehttps://github.com/ExPixel/miniaudio-rs
repositoryhttps://github.com/ExPixel/miniaudio-rs
max_upload_size
id226392
size206,271
Adolph C. (ExPixel)

documentation

https://docs.rs/miniaudio

README

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

If the bindgen feature is turned off:
Then you shouldn't need to do anything special, the bindings should just work. If they don't please open an issue.

If the bindgen feature is turned on:
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

For more examples, check out the examples directory.

//! 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");
}
Commit count: 240

cargo fmt