rotary
A library for working with audio buffers
The buffer is constructed similarly to a Vec<Vec<T>>
, except the interior
vector has a fixed size. And the buffer makes no attempt to clear data which
is freed when using functions such as Dynamic::resize.
use Rng as _;
let mut buffer = new;
buffer.resize_channels;
buffer.resize;
/// Fill both channels with random noise.
let mut rng = thread_rng;
rng.fill;
rng.fill;
You can use the included [Mask] trait to separately keep track of active and inactive channels in an audio buffer. This requires that you specify the type of the mask. A good option for this is a BitSet, which supports up to 128 channels.
use ;
let mut buffer = with_topology;
let mask: BitSet = bit_set!;
for chan in mask.join
let zeroed = vec!;
let expected = vec!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
For convenience we also provide the dynamic! macro when constructing audio buffers.
use BitSet;
let mut buf = with_topology;
for channel in &mut buf
assert_eq!
License: MIT/Apache-2.0