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

Method process_f32

perro_source/audio_stack/perro_pawdio/src/mic.rs:429–452  ·  view source on GitHub ↗
(&mut self, sample: f32)

Source from the content-addressed store, hash-verified

427pub 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
443impl 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

Callers 2

process_i16Method · 0.80
push_f32Function · 0.80

Calls 2

clampMethod · 0.45
absMethod · 0.45

Tested by

no test coverage detected