Trait Sample
pub trait Sample:
Sized
+ Copy
+ Clone
+ Add<Output = Self>
+ Sub<Output = Self>
+ Default
+ PartialOrd
+ PartialEq {
const FORMAT: SampleFormat;
const EFF_BITS: u32;
const MID: Self;
// Required method
fn clamped(self) -> Self;
}
dep_symphonia
only.Expand description
Sample
provides a common interface for manipulating sample’s regardless of the
underlying data type. Additionally, Sample
provides information regarding the
format of underlying data types representing the sample when in memory, but also
when exported.
Required Associated Constants§
const FORMAT: SampleFormat
const FORMAT: SampleFormat
A unique enum value representing the sample format. This constant may be used to dynamically choose how to process the sample at runtime.
const EFF_BITS: u32
const EFF_BITS: u32
The effective number of bits of the valid (clamped) sample range. Quantifies the dynamic range of the sample format in bits.
const MID: Self
const MID: Self
The mid-point value between the maximum and minimum sample value. If a sample is set to this value it is silent.
Required Methods§
fn clamped(self) -> Self
fn clamped(self) -> Self
If the sample format does not use the full range of the underlying data type, returns the sample clamped to the valid range. Otherwise, returns the sample unchanged.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.