pub struct MixedAudio {
pub samples: Vec<f32>,
pub original_channels: u8,
pub peak_before_mix: f32,
pub peak_after_mix: f32,
}Expand description
Mono audio with metadata from channel mixing.
Contains the mixed mono samples plus diagnostic information about the original channel layout and peak amplitudes before/after mixing.
Fields§
§samples: Vec<f32>Mono audio samples in the range [-1.0, 1.0].
original_channels: u8Original number of channels before mixing (1 = already mono).
peak_before_mix: f32Peak amplitude in the original multi-channel audio.
peak_after_mix: f32Peak amplitude after mixing to mono.
Implementations§
Source§impl MixedAudio
impl MixedAudio
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Total number of mono samples.
Sourcepub fn is_clipped(&self) -> bool
pub fn is_clipped(&self) -> bool
Check if any clipping occurred during mixing.
Returns true if the peak amplitude equals 1.0 (indicating potential
clipping at the boundaries).
Sourcepub fn peak_ratio(&self) -> f32
pub fn peak_ratio(&self) -> f32
Calculate the peak reduction ratio from mixing.
Returns the ratio of post-mix peak to pre-mix peak. A value of 1.0 means no amplitude change, <1.0 means reduction, >1.0 means amplification (rare with averaging).
Trait Implementations§
Source§impl Clone for MixedAudio
impl Clone for MixedAudio
Source§fn clone(&self) -> MixedAudio
fn clone(&self) -> MixedAudio
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more