Crate sampletypes

Source

Re-exports§

pub use mod_i24::*;
pub use mod_u24::*;

Modules§

mod_i24
mod_u24

Macros§

as_f32
Cast to f32
as_f64
Cast to f64
as_i8
Cast to i8
as_i16
Cast to i16
as_i24
Cast to i24
as_i32
Cast to i32
as_i64
Cast to i64
as_i128
Cast to i128
as_longer
Cast the current type to the longer type.
as_shorter
Cast the current type to the shorter type.
as_type
Cast to a specific type number
as_u8
Cast to u8
as_u16
Cast to u16
as_u24
Cast to u24
as_u32
Cast to u32
as_u64
Cast to u64
as_u128
Cast to u128
average_arr
Get the average value from a sample array.
call_as_type
Let known type of SampleType instance to call as_Xxx()
call_to_type
Let known type of SampleType instance to call to_Xxx()
cos
Cosine wave generator
get_suitable_float
Get the suitable float type for the source type to perform losslessly conversion
impl_sample_from
impl_sample_type
Implement SampleType for a specific numeric type.
is_float
Is this type an IEEE 754 floating point number?
is_integer
Is this type an integer?
is_signed
Is this type a signed number?
is_unsigned
Is this type an unsigned number?
longer_type
Get the longer type of the current type.
mid_number
Get the middle number of a specific type
shorter_type
Get the shorter type of the current type.
signed_type
Get the signed type of a specific type, no effect to f32 and f64
sin
Sine wave generator
sizeof
Get the size of as specific type in bytes
to_f32
Scale to [-1.0, 1.0] range
to_f64
Scale to [-1.0, 1.0] range
to_i8
Scale to i8 range
to_i16
Scale to i16 range
to_i24
Scale to i24 range
to_i32
Scale to i32 range
to_i64
Scale to i64 range
to_i128
Scale to i128 range
to_longer
Scale the current type number to the longer type number.
to_shorter
Scale the current type number to the shorter type number.
to_signed
Scale the type to the corresponding signed type number
to_suitable_float
Scale to [-1.0, 1.0] range
to_type
Scale to a specific type number
to_u8
Scale to u8 range
to_u16
Scale to u16 range
to_u24
Scale to u24 range
to_u32
Scale to u32 range
to_u64
Scale to u64 range
to_u128
Scale to u128 range
to_unsigned
Scale the type to the corresponding unsigned type number
unsigned_type
Get the unsigned type of a specific type, no effect to f32 and f64
zero_number
Get the zero number of a specific type

Traits§

Numeric
Basic numeric trait can do +, -, *, /, +=, -=, *=, /=
SampleFrom
The SampleFrom as a utility for SampleType to handle function overloading
SampleType
The SampleType for audio processing.The to_*() methods are for scaling the sample to the another format.The as_*() methods are for casting the sample to the another format.
SampleTypeInteger
Integers can do &, |, ^
SampleTypeIntegerSigned
Signed integers can do -x