ems
ep-miniaudio-sys
cargo install ep-miniaudio-sys
ems

ep-miniaudio-sys

Rust bindings for miniaudio C library.

by Adolph C.

2.4.0 (see all)License:MIT
cargo install ep-miniaudio-sys
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

LLVM and clang must be installed in order to generate the bindings. Installation instructions can be found here: https://rust-lang.github.io/rust-bindgen/requirements.html

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");
}

GitHub Stars

42

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

8

OPEN ISSUES

4

OPEN PRs

7
VersionTagPublished
2.4.0
2yrs ago
2.3.1
2yrs ago
2.3.0
2yrs ago
2.2.0
2yrs ago
No alternatives found
No tutorials found
Add a tutorial