audio_device/
lib.rs

1//! A library for interacting with audio devices.
2//!
3//! The sole aim of this crate is to provide idiomatic *low level* audio
4//! interface drivers that can be used independently. If all you need is WASAPI
5//! or ALSA, then that is all you pay for and you should have a decent
6//! Rust-idiomatic programming experience.
7//!
8//! This is part of the [audio ecosystem] and makes use of core traits provided
9//! by the [audio-core] crate.
10//!
11//! # Examples
12//!
13//! * [ALSA blocking playback][alsa-blocking].
14//! * [ALSA async playback][alsa-async].
15//! * [WASAPI blocking playback][wasapi-blocking].
16//! * [WASAPI async playback][wasapi-async].
17//!
18//! # Support
19//!
20//! Supported tier 1 platforms and systems are the following:
21//!
22//! | Platform | System | Blocking | Async   |
23//! |----------|--------|----------|---------|
24//! | Windows  | WASAPI | **wip**  | **wip** |
25//! | Linux    | ALSA   | **wip**  | **wip** |
26//!
27//! [audio ecosystem]: https://docs.rs/audio
28//! [alsa-blocking]: https://github.com/udoprog/audio/blob/main/audio-device/examples/alsa.rs
29//! [alsa-async]: https://github.com/udoprog/audio/blob/main/audio-device/examples/alsa-async.rs
30//! [audio-core]: https://docs.rs/audio-core
31//! [wasapi-async]: https://github.com/udoprog/audio/blob/main/audio-device/examples/wasapi-async.rs
32//! [wasapi-blocking]: https://github.com/udoprog/audio/blob/main/audio-device/examples/wasapi.rs
33
34#![warn(missing_docs)]
35#![cfg_attr(docsrs, feature(doc_cfg))]
36
37pub(crate) mod loom;
38
39#[macro_use]
40#[doc(hidden)]
41mod macros;
42
43cfg_unix! {
44    #[macro_use]
45    pub mod unix;
46}
47
48cfg_wasapi! {
49    pub mod wasapi;
50}
51
52cfg_windows! {
53    pub mod windows;
54}
55
56cfg_unix! {
57    pub mod libc;
58}
59
60cfg_alsa! {
61    pub mod alsa;
62}
63
64pub mod runtime;
65
66mod error;
67pub use self::error::{Error, Result};