(&mut self, sample: f32)
| 427 | pub struct MicSettings { |
| 428 | pub max_seconds: f32, |
| 429 | pub denoise: MicDenoiseSettings, |
| 430 | /// Backend device name from [`mic_devices`]. `None` or blank picks the OS default. |
| 431 | pub device: Option<String>, |
| 432 | pub channels: MicChannels, |
| 433 | /// Input sensitivity: linear gain applied before denoise. `1.0` is unity; |
| 434 | /// values are clamped to [`Self::GAIN_RANGE`]. |
| 435 | pub gain: f32, |
| 436 | /// Slow automatic gain on top of `gain`: boosts quiet mics toward a |
| 437 | /// comfortable speech level (never attenuates below the manual gain, |
| 438 | /// boost capped at 4x). Good default for player voice chat where mic |
| 439 | /// hardware varies wildly. |
| 440 | pub auto_gain: bool, |
| 441 | } |
| 442 | |
| 443 | impl Default for MicSettings { |
| 444 | fn default() -> Self { |
| 445 | Self { |
| 446 | max_seconds: 30.0, |
| 447 | denoise: MicDenoiseSettings::off(), |
| 448 | device: None, |
| 449 | channels: MicChannels::Auto, |
| 450 | gain: 1.0, |
| 451 | auto_gain: false, |
| 452 | } |
| 453 | } |
| 454 | } |
| 455 |
no test coverage detected