Skip to main content

ResampleSample

Trait ResampleSample 

Source
pub trait ResampleSample:
    Copy
    + CoerceFrom<usize>
    + CoerceFrom<f64>
    + CoerceFrom<f32>
    + FftNum
    + Mul
    + Div
    + Add
    + Sub
    + MulAssign
    + RemAssign
    + DivAssign
    + SubAssign
    + AddAssign
    + AvxSample
    + SseSample
    + NeonSample
    + Send {
    const PI: Self;

    // Required methods
    fn sin(self) -> Self;
    fn cos(self) -> Self;

    // Provided method
    fn coerce<T>(value: T) -> Self
       where Self: CoerceFrom<T> { ... }
}
Expand description

What read needs of a sample type beyond being a float, which is whatever the resampler needs of it. With the resample feature that is rubato::Sample. The trait governing a single sample.

There are two types which implements this trait so far:

Required Associated Constants§

Source

const PI: Self

Required Methods§

Source

fn sin(self) -> Self

Calculate the sine of self.

Source

fn cos(self) -> Self

Calculate the cosine of self.

Provided Methods§

Source

fn coerce<T>(value: T) -> Self
where Self: CoerceFrom<T>,

Coerce value into the current type.

Coercions are governed through the private CoerceFrom trait.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Sample for f32

Source§

const PI: f32 = std::f32::consts::PI

Source§

fn sin(self) -> f32

Source§

fn cos(self) -> f32

Source§

impl Sample for f64

Source§

const PI: f64 = std::f64::consts::PI

Source§

fn sin(self) -> f64

Source§

fn cos(self) -> f64

Implementors§