Skip to main content

AudioEffect

Trait AudioEffect 

Source
pub trait AudioEffect:
    Send
    + Sync
    + Debug {
    // Required methods
    fn validate(&self, rate: u32) -> Result<(), ValidationError>;
    fn process(&self, input: &mut [f32], channels: u16, rate: u32) -> Result;

    // Provided method
    fn tail(&self) -> Duration { ... }
}
Expand description

A deterministic offline effect. Mixers process from the occurrence origin once, retain the result, then serve exact random-access windows without IIR warmup errors.

Required Methods§

Source

fn validate(&self, rate: u32) -> Result<(), ValidationError>

Validates parameters at the native source rate, without processing PCM.

Source

fn process(&self, input: &mut [f32], channels: u16, rate: u32) -> Result

Processes complete interleaved frames from a zero initial state.

Provided Methods§

Source

fn tail(&self) -> Duration

Extra silent input needed to render a bounded decay tail.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§