https://github.com/rustaudio/rms
A simple type for calculating and storing the RMS given some buffer of interleaved audio samples.
https://github.com/rustaudio/rms
Last synced: 4 months ago
JSON representation
A simple type for calculating and storing the RMS given some buffer of interleaved audio samples.
- Host: GitHub
- URL: https://github.com/rustaudio/rms
- Owner: RustAudio
- Created: 2015-03-27T06:05:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-05T11:32:58.000Z (about 10 years ago)
- Last Synced: 2025-09-12T18:29:44.296Z (4 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 8
- Watchers: 18
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rms [](https://travis-ci.org/RustAudio/rms)
A simple type for calculating and storing the RMS given some buffer of interleaved audio samples.
Usage
-----
```Rust
const WINDOW_SIZE_MS: f64 = 10.0;
let mut rms = Rms::new(WINDOW_SIZE_MS);
rms.udpate(&sample_buffer[..], dsp_settings);
println!("Average RMS across channels at the last frame: {:?}", rms.avg_at_last_frame());
println!("RMS for each channel at the last frame: {:?}", rms.per_channel_at_last_frame());
```
The `Rms` type also implements `dsp-chain`'s `Dsp` trait, meaning it can be updated as a node within a DspGraph.
Add the `rms` crate to your dependencies like so:
```
[dependencies]
rms = ""
```