Skip to content
A simple Noise Gate algorithm for splitting an audio stream into chunks based on volume/silence
Rust
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
benches
data
examples
src Ran cargo fmt Oct 27, 2019
.gitignore
.rustfmt.toml
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md

README.md

Noise Gate

A simple Noise Gate algorithm for splitting an audio stream into chunks based on volume/silence.

For an in-depth explanation of how this crate works check out the accompanying blog post.

Getting Started

This project is just a crate so you'll need to add it to your own program if you want to use it.

The wav-splitter example shows how you could pipe the input from a WAV file through the NoiseGate. It also contains a simple Sink which will write each snippet of continuous audio to WAV files on disk.

For example, to split data/N11379_KSCK.wav with a noise threshold of 50 and release time of 0.3 seconds, writing the clips to the output/ directory, you would run the example as follows:

$ cargo run --release --example wav-splitter -- \
    --output-dir output \
    --threshold 50 \
    --release-time 0.3 \
    data/N11379_KSCK.wav
$ ls output
clip_0.wav   clip_3.wav   clip_6.wav   clip_9.wav   clip_12.wav  clip_15.wav
clip_18.wav  clip_21.wav  clip_1.wav   clip_4.wav   clip_7.wav   clip_10.wav
clip_13.wav  clip_16.wav  clip_19.wav  clip_22.wav  clip_2.wav   clip_5.wav
clip_8.wav   clip_11.wav  clip_14.wav  clip_17.wav  clip_20.wav

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You can’t perform that action at this time.