rotary
A library for dealing efficiently with AudioBuffer non-interleaved 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 AudioBuffer::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 masked audio buffers if you need the ability to temporarily enable or disable channels. 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 BitSet;
let mut buffer = with_topology;
buffer.mask;
for channel in buffer.iter_mut
let expected = vec!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
For convenience we also provide the audio_buffer! macro when constructing audio buffers.
use BitSet;
let mut buf = with_topology;
for channel in &mut buf
assert_eq!
License: MIT/Apache-2.0