Struct AudioEncoding
#[non_exhaustive]pub struct AudioEncoding {
pub config: Config,
pub group_span: Duration,
}Expand description
How an audio source is encoded: moq-audio’s encoder settings and the span of each group.
Build one from a preset in audio_encoding, or
from any moq-audio Config through From.
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.config: ConfigThe encoder settings: codec, sample rate, layout, bitrate, frame duration.
group_span: DurationHow much audio each group carries, moq-audio’s join.
Each group is a stream of its own on the wire. A shorter span loses less audio when a packet is lost, since a loss stalls only the rest of its group, and lets a new subscriber start closer to the live edge. A longer one opens fewer streams, which matters most at a media relay that fans out to many subscribers. moq-audio’s default is 100 ms; 20 ms, one Opus frame per group, was its default before. It cannot be zero.
Implementations§
§impl AudioEncoding
impl AudioEncoding
pub fn new(config: Config) -> AudioEncoding
pub fn new(config: Config) -> AudioEncoding
Creates an encoding of config with moq-audio’s default group span.
pub fn with_group_span(self, span: Duration) -> AudioEncoding
pub fn with_group_span(self, span: Duration) -> AudioEncoding
Returns this encoding with each group carrying span of audio.
See group_span for the trade-off.
Trait Implementations§
§impl Clone for AudioEncoding
impl Clone for AudioEncoding
§fn clone(&self) -> AudioEncoding
fn clone(&self) -> AudioEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more