Crates.io | om-fork-miniaudio |
lib.rs | om-fork-miniaudio |
version | |
source | src |
created_at | 2022-04-16 17:01:55.507847 |
updated_at | 2025-02-07 11:24:29.725188 |
description | Bindings to the miniaudio C library. Fork until upstream is updated! |
homepage | https://github.com/andreasOM/miniaudio-rs |
repository | https://github.com/andreasOM/miniaudio-rs |
max_upload_size | |
id | 569056 |
Cargo.toml error: | TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Note: The upstream version is is archived. I currently don't use this anymore, but will do an update now and then. Most of it is untested.
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. **
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
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");
}