Skip to content

Commit

Permalink
raise thread sleep a little; improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-cw committed Jul 4, 2022
1 parent 6c4dbff commit dfe9216
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,20 @@ sudo apt update && sudo apt install -y libasound2-dev pkg-config
```

- install the Rust toolchain
- run `cargo build --release`
- run `cargo build --release --path <PATH>` and choose where to install the binary.

##### listen
- start the application with cargo or directly running the binary and pick your vibe:
- start the application by picking your current vibe:

``` sh
cargo run -- jazz
```
or

``` sh
./target/release/chaintrak ambient
chaintrak jazz
chaintrak ambient
```

#### TODO
- lazy load of samples depending on the vibe
- normalize volumes
- add more vibez

#### license
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/)
Expand Down
3 changes: 2 additions & 1 deletion src/engine/ambient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ pub fn play(events: Receiver<Event>) -> anyhow::Result<()> {
output.play_raw(badger.decoder()?.convert_samples())?;
}

thread::sleep(Duration::from_millis(10));
// sleep to avoid looping too much
thread::sleep(Duration::from_millis(20));
}
}

5 changes: 3 additions & 2 deletions src/engine/jazz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn play(events: Receiver<Event>) -> anyhow::Result<()> {
}

if sax {
log::info!("Oh yeah 🎷");
log::info!("epic sax guy 🎷");
let sax = &samples.saxes.choose(&mut rng).context("no saxes")?;
output.play_raw(sax.decoder()?.convert_samples())?;
}
Expand All @@ -65,6 +65,7 @@ pub fn play(events: Receiver<Event>) -> anyhow::Result<()> {
output.play_raw(bass.decoder()?.convert_samples())?;
}

thread::sleep(Duration::from_millis(10));
// sleep to avoid looping too much
thread::sleep(Duration::from_millis(20));
}
}

0 comments on commit dfe9216

Please sign in to comment.