MCPcopy Create free account
hub / github.com/PerroEngine/Perro / cache_len

Method cache_len

perro_source/audio_stack/perro_pawdio/src/internal.rs:508–510  ·  view source on GitHub ↗

Bytes this entry pins in the cache budget (compressed + decoded PCM).

(&self)

Source from the content-addressed store, hash-verified

506impl CachedPcm {
507 pub(crate) fn byte_len(&self) -> usize {
508 self.samples.len() * std::mem::size_of::<f32>()
509 }
510
511 pub(crate) fn duration(&self) -> Duration {
512 let frames = self.samples.len() as u64 / self.channels.max(1) as u64;
513 Duration::from_secs_f64(frames as f64 / self.sample_rate.max(1) as f64)

Calls 3

lenMethod · 0.45
as_refMethod · 0.45
byte_lenMethod · 0.45

Tested by

no test coverage detected