| Crates.io | asio-sys |
| lib.rs | asio-sys |
| version | 0.2.5 |
| created_at | 2019-07-05 18:21:20.097076+00 |
| updated_at | 2026-01-04 14:40:20.221097+00 |
| description | Low-level interface and binding generation for the steinberg ASIO SDK. |
| homepage | |
| repository | https://github.com/RustAudio/cpal/ |
| max_upload_size | |
| id | 146599 |
| size | 95,127 |
Low-level Rust bindings for the Steinberg ASIO SDK.
ASIO (Audio Stream Input/Output) is a low-latency audio API for Windows that provides direct hardware access, bypassing the Windows audio stack for minimal latency.
asio-sys provides raw FFI bindings to the ASIO SDK, automatically generated using bindgen. This crate is used by cpal's ASIO backend to provide low-latency audio on Windows.
Note: Most users should use cpal's safe, cross-platform API rather than using asio-sys directly.
choco install llvmCPAL_ASIO_DIR environment variable to point to a local SDKbindgen - Generates Rust bindings from C/C++ headerscc - Compiles the ASIO SDK C++ fileswalkdir - Finds SDK filesAdd to your Cargo.toml:
[dependencies]
asio-sys = "0.2"
use asio_sys as sys;
fn main() {
// Load ASIO driver
let driver_name = "ASIO4ALL v2"; // Your ASIO driver name
unsafe {
// Initialize ASIO
let drivers = sys::get_driver_names();
println!("Available drivers: {drivers:?}");
// Load a driver
match sys::load_asio_driver(driver_name) {
Ok(driver) => println!("Loaded driver: {driver_name}"),
Err(e) => eprintln!("Failed to load driver: {e:?}"),
}
}
}
CPAL_ASIO_DIR: Path to ASIO SDK directory (optional)
set CPAL_ASIO_DIR=C:\path\to\asiosdkASIO is Windows-only. This crate will not build on other platforms.
This crate provides raw FFI bindings to C++ code. Almost all functions are unsafe and require careful handling:
Licensed under the Apache License, Version 2.0. See LICENSE for details.
The ASIO SDK is owned by Steinberg Media Technologies GmbH. Users must comply with Steinberg's licensing terms.
Contributions are welcome! Please submit issues and pull requests to the cpal repository.