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

Function push_i16

perro_source/audio_stack/perro_pawdio/src/mic.rs:726–741  ·  view source on GitHub ↗
(
    data: &[i16],
    out: &Arc<Mutex<Vec<i16>>>,
    stream_cursor: &Arc<Mutex<usize>>,
    max_samples: usize,
    denoise: &mut MicDenoiseState,
)

Source from the content-addressed store, hash-verified

724 if out.is_empty() && !errors.is_empty() {
725 return Err(format!("mic device scan failed: {}", errors.join(" | ")));
726 }
727 Ok(out)
728}
729
730#[cfg(target_arch = "wasm32")]
731pub fn mic_devices() -> Result<Vec<MicDevice>, String> {
732 Ok(Vec::new())
733}
734
735/// Menu labels that stay distinct when a backend lists twin devices.
736#[cfg(not(target_arch = "wasm32"))]
737fn dedupe_labels(names: &[&str]) -> Vec<String> {
738 let mut labels = Vec::with_capacity(names.len());
739 for (index, name) in names.iter().enumerate() {
740 let seen = names[..index].iter().filter(|prev| *prev == name).count();
741 if seen == 0 {
742 labels.push((*name).to_string());
743 } else {
744 labels.push(format!("{name} #{}", seen + 1));

Callers 1

start_streamFunction · 0.85

Calls 4

trim_samplesFunction · 0.85
extendMethod · 0.80
process_i16Method · 0.80
iterMethod · 0.45

Tested by

no test coverage detected