[][src]Struct noise_gate::NoiseGate

pub struct NoiseGate<S> {
    pub open_threshold: S,
    pub release_time: usize,
    // some fields omitted
}

A Noise Gate which can be used to split a stream of audio based on volume, skipping periods of silence.

Fields

open_threshold: S

The volume level at which the gate will open (begin recording).

release_time: usize

The amount of time (in samples) the gate takes to go from open to fully closed.

Methods

impl<S> NoiseGate<S>[src]

pub const fn new(open_threshold: S, release_time: usize) -> Self[src]

Create a new NoiseGate.

pub fn is_open(&self) -> bool[src]

Is the gate currently passing samples through to the Sink?

pub fn is_closed(&self) -> bool[src]

Is the gate currently ignoring silence?

impl<S: Sample> NoiseGate<S>[src]

pub fn process_frames<K, F>(&mut self, frames: &[F], sink: &mut K) where
    F: Frame<Sample = S>,
    K: Sink<F>, 
[src]

Process a batch of frames, passing spans of noise through to a sink.

Trait Implementations

impl<S: Clone> Clone for NoiseGate<S>[src]

impl<S: PartialEq> PartialEq<NoiseGate<S>> for NoiseGate<S>[src]

impl<S: Debug> Debug for NoiseGate<S>[src]

Auto Trait Implementations

impl<S> Send for NoiseGate<S> where
    S: Send

impl<S> Sync for NoiseGate<S> where
    S: Sync

impl<S> Unpin for NoiseGate<S> where
    S: Unpin

impl<S> UnwindSafe for NoiseGate<S> where
    S: UnwindSafe

impl<S> RefUnwindSafe for NoiseGate<S> where
    S: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]