pub trait AudioEffect: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn process(&mut self, samples: &mut [f32], sample_rate: u32) -> Result<()>;
fn reset(&mut self) -> Result<()>;
fn is_enabled(&self) -> bool;
fn set_enabled(&mut self, enabled: bool);
fn get_parameters(&self) -> HashMap<String, f32>;
fn set_parameter(&mut self, name: &str, value: f32) -> Result<()>;
}Expand description
Audio effect trait
Required Methods§
Sourcefn process(&mut self, samples: &mut [f32], sample_rate: u32) -> Result<()>
fn process(&mut self, samples: &mut [f32], sample_rate: u32) -> Result<()>
Process audio samples
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Check if effect is enabled
Sourcefn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Set enabled state
Sourcefn get_parameters(&self) -> HashMap<String, f32>
fn get_parameters(&self) -> HashMap<String, f32>
Get effect parameters