#[non_exhaustive]pub struct Settings {
pub codec: Codec,
pub sample_rate: u32,
pub layout: Layout,
pub bitrate: Option<Rate>,
pub dtx: bool,
pub frame_duration: Duration,
pub kind: Kind,
}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.codec: CodecOutput codec. Defaults to Codec::Opus.
sample_rate: u32Sample rate accepted by the codec.
layout: LayoutLayout accepted by the codec.
AAC takes the layouts its channelConfiguration names: mono, stereo, 3.0, 4.0, 5.0, 5.1, and 7.1.
bitrate: Option<Rate>Bitrate in bits per second. None lets the codec pick. PCM requires
None because its bitrate is fixed by the sample rate and channel count.
Rates too low for Opus to code anything at the chosen
frame_duration are rejected. The floor is 1200
bps at the default 20 ms, rises for shorter frames, and is 2400 bps for
frames of 10 ms and longer.
dtx: boolEnable Opus discontinuous transmission during silence.
frame_duration: DurationEncoded frame duration. Opus accepts 2.5 / 5 / 10 / 20 / 40 / 60 ms.
PCM accepts any duration containing a whole number of samples. AAC frames
are 1024 samples, so it accepts the duration that rounds to that at
sample_rate, which from_input
fills in.
kind: KindWhich encoder implementation to use.