Expand description
Pure functions and traits for converting between i8, i16, I24, i32, I48, i64, u8, u16, U24, u32, U48, u64, f32 and f64.
Each conversion function is performance focused, memory-sensitive and expects that the user has validated their input prior to the function call.
No conversion function will ever cast to a type with a size in bytes larger than the largest between the source and target sample types.
The conversion functions do not check the range of incoming values for floating point values
or any of the custom I24
, U24
, I48
and U48
types.
Note that floating point conversions use the range -1.0 <= v < 1.0:
(1.0 as f64).to_sample::<i16>()
will overflow!
Modules§
Traits§
- Duplex
- Sample types which may be converted to and from some type
S
. - Duplex
Boxed Frame Slice - Duplex
Boxed Sample Slice - Duplex
Boxed Slice - Duplex
Frame Slice - Duplex
Frame Slice Mut - Duplex
Sample Slice - Duplex
Sample Slice Mut - Duplex
Slice - Duplex
Slice Mut - From
Boxed Frame Slice - For converting from a boxed slice of
Frame
s to a boxed slice ofSample
s. - From
Boxed Sample Slice - For converting a boxed slice of
Sample
s to a boxed slice ofFrame
s. - From
Frame Slice - For converting from a slice of
Frame
s to a slice ofSample
s. - From
Frame Slice Mut - For converting from a slice of
Frame
s to a slice ofSample
s. - From
Sample - Similar to the std
From
trait, but specifically for converting between sample types. - From
Sample Slice - For converting from a slice of
Sample
s to a slice ofFrame
s. - From
Sample Slice Mut - For converting from a mutable slice of
Sample
s to a mutable slice ofFrame
s. - ToBoxed
Frame Slice - For converting from a boxed slice of
Sample
s to a boxed slice ofFrame
s. - ToBoxed
Sample Slice - For converting from a boxed slice of
Frame
s to a boxed slice ofSample
s. - ToFrame
Slice - For converting from a slice of
Sample
s to a slice ofFrame
s. - ToFrame
Slice Mut - For converting from a mutable slice of
Sample
s to a mutable slice ofFrame
s. - ToSample
- Similar to the std
Into
trait, but specifically for converting between sample types. - ToSample
Slice - For converting from a slice of
Frame
s to a slice ofSample
s. - ToSample
Slice Mut - For converting from a mutable slice of
Frame
s to a mutable slice ofSample
s.