pub struct Stretch<S: SignalMut, I: Interpolate>{ /* private fields */ }Expand description
Samples a SignalMut and time-stretches it. Both pitch and speed will be modified.
Implementations§
Source§impl<S: SignalMut, I: Interpolate> Stretch<S, I>
impl<S: SignalMut, I: Interpolate> Stretch<S, I>
Sourcepub fn new(sgn: S, factor: f64) -> Self
pub fn new(sgn: S, factor: f64) -> Self
Initializes a new Stretch.
If you call this function, you’ll have to write down the interpolation mode explicitly.
Consider instead calling one of Self::new_drop, Self::new_linear,
Self::new_cubic or Self::new_hermite.
Sourcepub const fn sgn(&self) -> &S
pub const fn sgn(&self) -> &S
Returns a reference to the original signal.
Note that the signal might have been read a few samples ahead of what’s currently playing, depending on the interpolation method.
Source§impl<S: SignalMut> Stretch<S, Drop<<S as Signal>::Sample>>
impl<S: SignalMut> Stretch<S, Drop<<S as Signal>::Sample>>
Sourcepub fn new_drop(sgn: S, factor: f64) -> Self
pub fn new_drop(sgn: S, factor: f64) -> Self
Initializes a new DropStretch.
Source§impl<S: SignalMut> Stretch<S, Linear<<S as Signal>::Sample>>
impl<S: SignalMut> Stretch<S, Linear<<S as Signal>::Sample>>
Sourcepub fn new_linear(sgn: S, factor: f64) -> Self
pub fn new_linear(sgn: S, factor: f64) -> Self
Initializes a new LinearStretch.
Trait Implementations§
Source§impl<S: SignalMut, I: Interpolate> Signal for Stretch<S, I>
impl<S: SignalMut, I: Interpolate> Signal for Stretch<S, I>
Source§fn _get(&self) -> Self::Sample
fn _get(&self) -> Self::Sample
Currently,
rust-analyzer trips up sometimes that get is called, confusing it with
Array::get. This hack bypasses this.Auto Trait Implementations§
impl<S, I> Freeze for Stretch<S, I>
impl<S, I> RefUnwindSafe for Stretch<S, I>where
S: RefUnwindSafe,
I: RefUnwindSafe,
impl<S, I> Send for Stretch<S, I>
impl<S, I> Sync for Stretch<S, I>
impl<S, I> Unpin for Stretch<S, I>
impl<S, I> UnwindSafe for Stretch<S, I>where
S: UnwindSafe,
I: UnwindSafe,
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