Expand description
§Examples
Strongly typed units can easily be converted into each other:
use rabu::units::{SampleRate, Samples, Seconds};
let seconds = Seconds::from(3.0);
let sample_rate = SampleRate::from(44100);
let samples = seconds.to_samples(sample_rate);
assert_eq!(samples, Samples::from(132_300));
Audio buffers can be used in a way that makes sense:
use rabu::buffer::Buffer;
use rabu::units::{Channels, Samples};
let mut buffer = Buffer::allocate(Channels::from(2), Samples::from(4));
for channel in buffer.iter_chans_mut() {
for sample in channel.iter_mut() {
*sample = 1.0;
}
}
Modules§
- This module contains a biquad filter that can be instantiated with provided coefficients. On top of that it contains some functions to create the coefficients for the basic filter types. Example of a low pass filter:
- This module contains a
Buffer
struct that is useful for many audio related tasks. It contains functions for iterating in audio specific ways and manipulating the sample data. - This module contains a lot of strong types for units and quantities that are audio related. These types have their corresponding conversion functions that make sense for that particular type. For example: a
Seconds
object can be converted to aSamples
object when given aSampleRate
value.