pub struct Sample {
pub buffer: [Vec<f32>; 2],
}Fields§
§buffer: [Vec<f32>; 2]Implementations§
Source§impl Sample
impl Sample
pub fn new() -> Sample
pub fn with_size(len: usize) -> Sample
pub fn from_mono(buffer: &[f32]) -> Sample
pub fn length(&self) -> u64
pub fn record(&mut self, data: &[&[f32]])
pub fn overdub( &mut self, time_in_samples: u64, data: &[&[f32]], speed: LooperSpeed, )
pub fn replace(&mut self, time_in_samples: u64, data: &[&[f32]])
pub fn clear(&mut self)
Sourcepub fn xfade(
&mut self,
xfade_size: usize,
start_time_in_fade: u64,
time_in_samples: u64,
data: &[&[f32]],
direction: XfadeDirection,
f: fn(f32) -> f32,
)
pub fn xfade( &mut self, xfade_size: usize, start_time_in_fade: u64, time_in_samples: u64, data: &[&[f32]], direction: XfadeDirection, f: fn(f32) -> f32, )
Performs a crossfade with the existing buffer using the given function The fade direction refers to the given sample – i.e., a fade in starts with 100% of the existing sample, and ends at 100% of the new sample.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sample
impl RefUnwindSafe for Sample
impl Send for Sample
impl Sync for Sample
impl Unpin for Sample
impl UnwindSafe for Sample
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more