kittyaudio/lib.rs
1//! kittyaudio is an audio library focusing on simplicity.
2//!
3//! # Example
4//!
5//! ```ignore
6//! use kittyaudio::{include_sound, Mixer};
7//!
8//! fn main() {
9//! // include a sound into the executable.
10//! // this type can be cheaply cloned.
11//! let sound = include_sound!("jump.ogg").unwrap();
12//!
13//! // create sound mixer
14//! let mut mixer = Mixer::new();
15//! mixer.init(); // use init_ex to specify settings
16//!
17//! let playing_sound = mixer.play(sound);
18//! playing_sound.set_volume(0.5); // decrease volume
19//!
20//! mixer.wait(); // wait for all sounds to finish
21//! }
22//! ```
23//!
24//! See more examples in the `examples` directory.
25//!
26//! # Features
27//!
28//! * Low-latency audio playback
29//! * Cross-platform audio playback (including wasm)
30//! * Handle device changes or disconnects in real time
31//! * Low CPU usage
32//! * Minimal dependencies
33//! * Minimal memory allocations
34//! * No `panic!()` or `.unwrap()`, always propogate errors
35//! * No unsafe code
36//! * Simple API, while being customizable
37//! * Optionally use [Symphonia](https://github.com/pdeljanov/Symphonia) to support most audio formats
38//! * Feature to disable audio playback support, if you want to use kittyaudio purely as an audio library
39//! * Commands to change volume, playback rate, position and panning in the sound with easings
40//! * Loops, and commands to change them with easings
41//!
42//! # Roadmap
43//!
44//! Those features are not implemented yet.
45//!
46//! * Effects (reverb, delay, eq, etc.)
47//! * C API
48//! * Audio streaming from disk
49
50#![warn(missing_docs)] // warn on missing function docs
51
52#[cfg(feature = "cpal")]
53mod backend;
54
55mod command;
56mod error;
57mod mixer;
58mod renderer;
59mod resampler;
60mod sound;
61
62#[cfg(feature = "cpal")]
63pub use backend::*;
64
65pub use command::*;
66pub use error::*;
67pub use mixer::*;
68pub use renderer::*;
69pub use resampler::*;
70pub use sound::*;
71
72// Re-export the cpal and symphonia crate
73#[cfg(feature = "cpal")]
74pub use cpal;
75
76#[cfg(feature = "symphonia")]
77pub use symphonia;