pub struct Engine {
pub stats: EngineStats,
/* private fields */
}Expand description
Streaming spectral gate.
Fields§
§stats: EngineStatsImplementations§
Source§impl Engine
impl Engine
pub fn new( cfg: GateConfig, noise: &NoiseModel, sample_rate: u32, channels: usize, ) -> Engine
pub fn fft_size(&self) -> usize
pub fn hop(&self) -> usize
Sourcepub fn latency(&self) -> usize
pub fn latency(&self) -> usize
Samples of output to discard at the start (the output stream starts n - hop
samples before the input).
Sourcepub fn push_hop(&mut self, input: &[&[f32]], out: &mut [Vec<f32>])
pub fn push_hop(&mut self, input: &[&[f32]], out: &mut [Vec<f32>])
Push hop samples per channel; appends any completed output samples to out.
Sourcepub fn process_buffer(
&mut self,
buf: &AudioBuffer,
progress: &mut dyn FnMut(f64) -> Result<()>,
) -> Result<AudioBuffer>
pub fn process_buffer( &mut self, buf: &AudioBuffer, progress: &mut dyn FnMut(f64) -> Result<()>, ) -> Result<AudioBuffer>
Process a whole buffer in hop-sized chunks (constant engine memory). progress is
called periodically with the fraction done and may abort by returning an error.
Auto Trait Implementations§
impl !RefUnwindSafe for Engine
impl !UnwindSafe for Engine
impl Freeze for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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