Skip to content

Commit

Permalink
Improve docs and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zeozeozeo committed Nov 30, 2023
1 parent a336732 commit e3e908e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
name = "kittyaudio"
description = "An audio playback library focusing on simplicity"
license = "MIT OR BSL-1.0"
version = "0.1.0"
version = "0.1.1"
exclude = ["assets/**"]
documentation = "https://docs.rs/kittyaudio"
homepage = "https://github.com/zeozeozeo/kittyaudio"
repository = "https://github.com/zeozeozeo/kittyaudio"
keywords = ["audio", "playback", "gamedev"]
categories = ["multimedia"]
edition = "2021"
readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# 🐱 kittyaudio

![docs.rs](https://img.shields.io/docsrs/kittyaudio) ![Downloads on Crates.io](https://img.shields.io/crates/d/kittyaudio)

#### [crates.io](https://crates.io/crates/kittyaudio) | [docs.rs](https://docs.rs/kittyaudio/0.1.0/kittyaudio/) | [examples](https://github.com/zeozeozeo/kittyaudio/tree/master/examples)

kittyaudio is a Rust audio playback library focusing on simplicity, speed and low-latency audio playback.

Installation with `cargo`:

```
cargo add kittyaudio
```

# Example

```rust
Expand All @@ -23,18 +33,25 @@ fn main() {
}
```

# Goals
# Features

* Low-latency audio playback
* Cross-platform audio playback (including wasm)
* Handle device changes or disconnects in real time
* Low CPU usage
* Minimal dependencies
* Minimal memory allocations
* Streaming and in-memory audio playback
* No `panic!()` or `.unwrap()`, always propogate errors
* No unsafe code
* Simple API, while being customizable
* Optionally use [Symphonia](https://github.com/pdeljanov/Symphonia) to support most audio formats
* Feature to disable audio playback support, if you want to use kittyaudio purely as an audio library
* Commands to change volume, playback rate and position in the sound with easings

# Roadmap

Those features are not implemented yet.

* Effects (reverb, delay, eq, etc.)
* C API
* Audio streaming from disk
51 changes: 49 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
//! KittyAudio is a Rust audio library focusing on simplicity.
#![warn(missing_docs)]
//! kittyaudio is an audio library focusing on simplicity.
//!
//! # Example
//!
//! ```rust
//! use kittyaudio::{include_sound, Mixer};
//!
//! fn main() {
//! // include a sound into the executable.
//! // this type can be cheaply cloned.
//! let sound = include_sound!("jump.ogg").unwrap();
//!
//! // create sound mixer
//! let mut mixer = Mixer::new();
//! mixer.init(); // use init_ex to specify settings
//!
//! let playing_sound = mixer.play();
//! playing_sound.set_volume(0.5); // decrease volume
//!
//! mixer.wait(); // wait for all sounds to finish
//! }
//! ```
//!
//! See more examples in the `examples` directory.
//!
//! # Features
//!
//! * Low-latency audio playback
//! * Cross-platform audio playback (including wasm)
//! * Handle device changes or disconnects in real time
//! * Low CPU usage
//! * Minimal dependencies
//! * Minimal memory allocations
//! * No `panic!()` or `.unwrap()`, always propogate errors
//! * No unsafe code
//! * Simple API, while being customizable
//! * Optionally use [Symphonia](https://github.com/pdeljanov/Symphonia) to support most audio formats
//! * Feature to disable audio playback support, if you want to use kittyaudio purely as an audio library
//! * Commands to change volume, playback rate and position in the sound with easings
//!
//! # Roadmap
//!
//! Those features are not implemented yet.
//!
//! * Effects (reverb, delay, eq, etc.)
//! * C API
//! * Audio streaming from disk
#![warn(missing_docs)] // warn on missing function docs

#[cfg(feature = "playback")]
mod backend;
Expand Down

0 comments on commit e3e908e

Please sign in to comment.