(
data: &[f32],
out: &Arc<Mutex<Vec<i16>>>,
stream_cursor: &Arc<Mutex<usize>>,
max_samples: usize,
denoise: &mut MicDenoiseState,
)
| 742 | labels.push((*name).to_string()); |
| 743 | } else { |
| 744 | labels.push(format!("{name} #{}", seen + 1)); |
| 745 | } |
| 746 | } |
| 747 | labels |
| 748 | } |
| 749 | |
| 750 | #[derive(Clone, Copy, Debug, PartialEq)] |
| 751 | pub struct MicDenoiseSettings { |
| 752 | pub enabled: bool, |
| 753 | /// Noise-gate threshold as a linear amplitude (0..=1). Samples below it |
| 754 | /// are attenuated by `reduction`. |
| 755 | pub noise_floor: f32, |
| 756 | /// How much of a below-floor sample is removed (0 = gate off, 1 = full mute). |
| 757 | pub reduction: f32, |
| 758 | pub high_pass: bool, |
| 759 | /// High-pass corner frequency in Hz (rumble/handling-noise cut). The |
| 760 | /// filter coefficient is derived from the actual stream rate, so the cut |
| 761 | /// lands at the same frequency on a 44.1 kHz headset and a 96 kHz interface. |
no test coverage detected