EchoFilter

Struct EchoFilter 

Source
pub struct EchoFilter { /* private fields */ }
Expand description

Echo filter

Implementations§

Source§

impl EchoFilter

Source

pub fn set_params(&mut self, delay: f32) -> Result<(), SoloudError>

Set filter params

Examples found in repository?
examples/filter.rs (line 9)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let mut sl = Soloud::default()?;
5    sl.set_global_volume(3.0);
6
7    let mut wav = audio::Wav::default();
8    let mut filt = filter::EchoFilter::default();
9    filt.set_params(0.2)?; // Here sets the delay by default for echo filters
10
11    wav.load("sample.wav")?;
12    wav.set_filter(0, Some(&filt));
13
14    sl.play(&wav);
15    while sl.voice_count() > 0 {
16        std::thread::sleep(std::time::Duration::from_millis(100));
17    }
18
19    Ok(())
20}
Source

pub fn set_params_ex( &mut self, delay: f32, decay: f32, filter: f32, ) -> Result<(), SoloudError>

Set filter params with extra args

Trait Implementations§

Source§

impl Debug for EchoFilter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for EchoFilter

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FilterExt for EchoFilter

Source§

unsafe fn inner(&self) -> *mut *mut c_void

Get the inner pointer Read more
Source§

fn default() -> Self

Creates a default initialized object
Source§

fn param_count(&mut self) -> i32

Get the param count
Source§

fn param_name(&mut self, param_idx: u32) -> Option<String>

Get the param name by index
Source§

fn param_type(&mut self, param_idx: u32) -> ParamType

Get the param type by index
Source§

fn param_max(&mut self, param_idx: u32) -> f32

Get the maximum value of a parameter
Source§

fn param_min(&mut self, param_idx: u32) -> f32

Get the minimum value of a parameter

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.