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

Method pack_v1

perro_source/audio_stack/perro_pawdio/src/mic.rs:89–100  ·  view source on GitHub ↗
(&self, frames: u32)

Source from the content-addressed store, hash-verified

87 pub const fn sample_rate(&self) -> u32 {
88 self.sample_rate
89 }
90
91 pub const fn channels(&self) -> u16 {
92 self.channels
93 }
94
95 pub fn duration(&self) -> Duration {
96 let frames = self.samples.len() as f64 / self.channels.max(1) as f64;
97 Duration::from_secs_f64(frames / self.sample_rate.max(1) as f64)
98 }
99
100 pub fn seconds(&self) -> f32 {
101 self.duration().as_secs_f32()
102 }
103

Callers 2

packMethod · 0.80
raw_bytesMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected