#miniaudio #pcm #sound

sys ep-miniaudio-sys

对 miniaudio C 库的原始绑定

11 个稳定版本

2.4.0 2020年7月23日
2.3.1 2020年7月21日
1.2.0 2020年6月29日
1.1.3 2020年4月20日
0.1.0 2020年4月4日

#27#pcm

Download history • Rust 包仓库 12/week @ 2024-03-12 • Rust 包仓库 4/week @ 2024-03-19 • Rust 包仓库 8/week @ 2024-03-26 • Rust 包仓库 35/week @ 2024-04-02 • Rust 包仓库 1/week @ 2024-04-09 • Rust 包仓库 1/week @ 2024-04-16 • Rust 包仓库 7/week @ 2024-04-23 • Rust 包仓库 1/week @ 2024-04-30 • Rust 包仓库 7/week @ 2024-05-07 • Rust 包仓库 5/week @ 2024-05-14 • Rust 包仓库 3/week @ 2024-05-21 • Rust 包仓库 58/week @ 2024-05-28 • Rust 包仓库 84/week @ 2024-06-04 • Rust 包仓库 2/week @ 2024-06-11 • Rust 包仓库

144 每月下载量
用于 3 个crate (通过 miniaudio)

MIT 许可证

2.5MB
52K SLoC

C 52K SLoC // 0.1% comments • Rust 包仓库 Rust 344 SLoC // 0.1% comments • Rust 包仓库

Mini Audio Rust 绑定

Build Status crates.io docs.rs

绑定到 https://github.com/dr-soft/miniaudio

** 该crate目前缺乏文档,但API与miniaudio C库的API非常接近。可以在C库的主要头文件中找到。**

构建

为了生成绑定,必须安装LLVM和clang。安装说明可以在这里找到: https://rust-lang.github.io/rust-bindgen/requirements.html

示例用法

更多示例,请查看 示例目录

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

依赖项