Skip to content

Commit

Permalink
doc(readme): use lib.rs as source for README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tversteeg authored and github-actions[bot] committed Oct 21, 2023
1 parent fc51e90 commit 451ec83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ randomize = "3.0.1"
[dev-dependencies]
cpal = "0.14.1"
criterion = "0.4.0"
doc-comment = "0.3.3"
sdl2 = "0.35.2"
rust-music-theory = "0.2.0"
rand = "0.8.5"
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<h1 align="center">μsfx</h1>
<p align="center">
Generate sound effects for your game in realtime.
</p>

<p align="center">
<a href="https://github.com/tversteeg/usfx/actions"><img src="https://github.com/tversteeg/usfx/workflows/CI/badge.svg" alt="CI"/></a>
Expand All @@ -11,6 +8,10 @@
<br/>
</p>

<!-- cargo-rdme start -->

Generate sound effects for your game in realtime.

## Example

```rust
Expand Down Expand Up @@ -43,6 +44,8 @@ mixer.play(sample);
mixer.generate(&mut audio_device_buffer);
```

<!-- cargo-rdme end -->

The [`cpal`](examples/cpal.rs) & [`sdl`](examples/sdl2.rs) examples illustrate how to use it with different audio libraries. The [`music`](examples/music.rs) example shows how to create procedurally generated music with it (don't expect a masterpiece though, it's obvious I'm not a musician).

### CPAL Example
Expand Down
7 changes: 1 addition & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! # usfx
//!
//! Generate sound effects for your game in realtime.
//!
//! ## Example
//!
//! ```rust
//! // Create a simple blip sound
//! let mut sample = usfx::Sample::default();
Expand Down Expand Up @@ -34,10 +33,6 @@
//! mixer.generate(&mut audio_device_buffer);
//! ```

// Test the code in README.md
#[cfg(test)]
doc_comment::doctest!("../README.md");

mod effects;
mod envelope;
mod oscillator;
Expand Down

0 comments on commit 451ec83

Please sign in to comment.