#[non_exhaustive]pub struct Input {
pub format: Format,
pub sample_rate: u32,
pub layout: Layout,
pub latency: Duration,
}Expand description
The PCM layout a Sink accepts.
The playback counterpart to encode::Input: it
describes the buffers you hand in, not the device, which is free to run at
its own rate and layout.
#[non_exhaustive]: construct via Input::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.format: FormatHow samples are packed in each buffer.
sample_rate: u32Samples per second per channel. Resampled to the device rate if they differ.
layout: LayoutSpeaker meaning and channel order. Remixed to the device’s layout, so it
must name speaker positions rather than be Layout::Discrete.
latency: DurationHow much audio to hold between Sink::write and the speaker (default:
50 ms).
The device pulls on its own clock, so this is the jitter a late write may
absorb without a dropout, and it is also delay: the sample handed over now
sounds this much later. A player that presents video against a playout
delay sets this to match, so the sink is where that delay lives rather
than something the picture has to be held back for separately. Once a
clock is due, the device’s own delay counts toward it and
the sink holds the rest. Must be non-zero: a ring with no depth can never
be read from.