Bytes this entry pins in the cache budget (compressed + decoded PCM).
(&self)
| 506 | impl 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) |
no test coverage detected