#[non_exhaustive]pub struct Config {
pub source: Source,
pub sample_rate: Option<u32>,
pub channels: Option<u32>,
pub aec: Option<Control>,
}Expand description
Audio capture configuration.
sample_rate and channels are requirements, not hints: a device that
cannot capture the requested format fails with Error::Unsupported instead
of opening at another one. Leave them None to take the device’s default;
the encode::Producer resamples and remixes to the
codec format either way.
#[non_exhaustive]: construct via Config::default and set fields, so
new options can be added without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source: SourceWhat to capture.
sample_rate: Option<u32>Samples per second the device must capture at. None takes its default.
channels: Option<u32>Channels the device must capture. None takes its default.
aec: Option<Control>Cancel the echo of what a speaker is playing, controlled by
Engine::canceller.
Applies to Source::Microphone only: system audio is already the
output, so there is nothing to subtract from it. Costs up to 10 ms of
capture latency while enabled. Clones may toggle the same adaptive state,
but only one live microphone can attach to it; another open returns
Error::Busy.
Requires the playback feature.