(
data: &[i16],
out: &Arc<Mutex<Vec<i16>>>,
stream_cursor: &Arc<Mutex<usize>>,
max_samples: usize,
denoise: &mut MicDenoiseState,
)
| 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")] |
| 731 | pub 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"))] |
| 737 | fn 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)); |
no test coverage detected