Skip to main content

AudioFilter

Trait AudioFilter 

Source
pub trait AudioFilter: Send {
    // Required method
    fn process(&mut self, frame: &mut [f32]);

    // Provided methods
    fn reconfigure(&mut self, _config: &Value) -> bool { ... }
    fn reset(&mut self) { ... }
}
Expand description

A running filter instance. The player builds one instance per deck (so two exist during a crossfade), and may call FilterFactory::create once more just to validate a configuration.

process runs on the real-time send path every 20 ms: it must not block, allocate heavily or do I/O.

Required Methods§

Source

fn process(&mut self, frame: &mut [f32])

Process one interleaved stereo frame in place, values in -1.0..=1.0.

Provided Methods§

Source

fn reconfigure(&mut self, _config: &Value) -> bool

A new configuration arrived for an already running filter. Return false to have the player rebuild the filter from the factory instead.

Source

fn reset(&mut self)

Clear internal state (called on seek and track change).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§