pub struct ConversionMetadata {
pub original_format: AudioFormat,
pub original_sample_rate: u32,
pub original_channels: u8,
pub original_bit_depth: Option<u16>,
pub peak_before: f32,
pub peak_after: f32,
pub conversion_time_ms: f64,
pub detection_time_ms: f64,
pub decode_time_ms: f64,
pub resample_time_ms: f64,
pub mix_time_ms: f64,
}Expand description
Metadata tracking the complete conversion pipeline journey.
Captures information from all four conversion stages.
Fields§
§original_format: AudioFormatDetected audio format (WAV, MP3, FLAC, etc.).
original_sample_rate: u32Original sample rate in Hz before resampling.
original_channels: u8Original number of channels before mixing.
original_bit_depth: Option<u16>Original bit depth (if applicable, e.g., 16, 24 for PCM).
peak_before: f32Peak amplitude in original audio before any processing.
peak_after: f32Peak amplitude after complete conversion pipeline.
conversion_time_ms: f64Total time spent in conversion pipeline (all 4 stages).
detection_time_ms: f64Time spent in format detection stage.
decode_time_ms: f64Time spent in decoding stage.
resample_time_ms: f64Time spent in resampling stage.
mix_time_ms: f64Time spent in channel mixing stage.
Implementations§
Source§impl ConversionMetadata
impl ConversionMetadata
Sourcepub fn has_performance_issue(&self) -> bool
pub fn has_performance_issue(&self) -> bool
Check if any stage exceeded expected latency budget.
Expected budget breakdown for 3s clip:
- Detection: <1ms
- Decoding: <3ms
- Resampling: <5ms
- Mixing: <1ms
- Total: <10ms
Sourcepub fn peak_ratio(&self) -> f32
pub fn peak_ratio(&self) -> f32
Calculate the peak amplitude reduction ratio from conversion.
Returns the ratio of final peak to original peak. Values:
- 1.0 = no amplitude change
- <1.0 = amplitude reduced (common with averaging/resampling)
-
1.0 = amplitude increased (rare, may indicate issue)
Trait Implementations§
Source§impl Clone for ConversionMetadata
impl Clone for ConversionMetadata
Source§fn clone(&self) -> ConversionMetadata
fn clone(&self) -> ConversionMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more