#[non_exhaustive]pub struct EngineConfig {Show 14 fields
pub backend: Backend,
pub processing: ProcessingConfig,
pub encoder: EncoderCfg,
pub jitter: JitterConfig,
pub initial_ts48k: u32,
pub playout_buffer_ms: u32,
pub capture_queue_frames: usize,
pub recv_queue_frames: usize,
pub max_participants: usize,
pub levels_interval_ms: u32,
pub speaking_threshold_dbov: f32,
pub device_poll_interval: Duration,
pub processing_poll: Duration,
pub dsp_sched: DspSchedConfig,
}Expand description
Everything crate::AudioEngine::start needs.
#[non_exhaustive]: start from EngineConfig::default (the system
devices) or EngineConfig::null and chain the with_ methods, or set
fields on a let mut.
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.backend: BackendDevices.
processing: ProcessingConfigCapture processing (echo cancellation, noise suppression, gain).
encoder: EncoderCfgInitial encoder settings.
jitter: JitterConfigJitter-buffer settings for every participant.
initial_ts48k: u32The first capture timestamp (crate::EncodedFrame::ts48k). RTP
recommends a random start.
playout_buffer_ms: u32Playback queued ahead of the output device, milliseconds (10..=200). Lower is less latency; higher survives scheduling hiccups.
capture_queue_frames: usizeCapacity of the encoded-frame queue, in frames (20 ms each).
recv_queue_frames: usizeCapacity of the receive queue, in frames.
max_participants: usizeThe most participants at once.
levels_interval_ms: u32Level reading interval, milliseconds (multiple of 10).
speaking_threshold_dbov: f32Level at or above which a stream counts as speaking, dBov.
device_poll_interval: DurationHow often to look for added or removed devices (hot-plug). Zero turns polling off; device errors are still handled.
processing_poll: DurationHow often the processing thread wakes to move audio. Must be well under 10 ms.
dsp_sched: DspSchedConfigHow the processing thread asks the OS to schedule it (macOS and iOS;
elsewhere it is reported as crate::DspSchedMode::Unsupported).
The default, crate::DspSchedMode::Workgroup, is 0.2.4’s
behaviour. Read once, as the thread starts; what it got is in
crate::Stats::dsp_sched and crate::Stats::dsp_scheduling.
crate::DspSchedConfig::from_env and
crate::DspSchedConfig::from_lookup read one from the environment
or an app’s settings.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn null(device: NullDevice) -> Self
pub fn null(device: NullDevice) -> Self
A config for the null device, everything else default.
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
Set backend.
Sourcepub fn with_processing(self, processing: ProcessingConfig) -> Self
pub fn with_processing(self, processing: ProcessingConfig) -> Self
Set processing.
Sourcepub fn with_capture_stage(self, stage: Box<dyn CaptureStage>) -> Self
pub fn with_capture_stage(self, stage: Box<dyn CaptureStage>) -> Self
Set the capture stage (ProcessingConfig::capture_stage), keeping
the rest of processing.
Sourcepub fn with_encoder(self, encoder: EncoderCfg) -> Self
pub fn with_encoder(self, encoder: EncoderCfg) -> Self
Set encoder.
Sourcepub fn with_jitter(self, jitter: JitterConfig) -> Self
pub fn with_jitter(self, jitter: JitterConfig) -> Self
Set jitter.
Sourcepub fn with_initial_ts48k(self, ts48k: u32) -> Self
pub fn with_initial_ts48k(self, ts48k: u32) -> Self
Set initial_ts48k.
Sourcepub fn with_playout_buffer_ms(self, ms: u32) -> Self
pub fn with_playout_buffer_ms(self, ms: u32) -> Self
Set playout_buffer_ms.
Sourcepub fn with_capture_queue_frames(self, frames: usize) -> Self
pub fn with_capture_queue_frames(self, frames: usize) -> Self
Set capture_queue_frames.
Sourcepub fn with_recv_queue_frames(self, frames: usize) -> Self
pub fn with_recv_queue_frames(self, frames: usize) -> Self
Set recv_queue_frames.
Sourcepub fn with_max_participants(self, n: usize) -> Self
pub fn with_max_participants(self, n: usize) -> Self
Set max_participants.
Sourcepub fn with_levels_interval_ms(self, ms: u32) -> Self
pub fn with_levels_interval_ms(self, ms: u32) -> Self
Set levels_interval_ms.
Sourcepub fn with_speaking_threshold_dbov(self, dbov: f32) -> Self
pub fn with_speaking_threshold_dbov(self, dbov: f32) -> Self
Sourcepub fn with_device_poll_interval(self, every: Duration) -> Self
pub fn with_device_poll_interval(self, every: Duration) -> Self
Set device_poll_interval.
Sourcepub fn with_processing_poll(self, every: Duration) -> Self
pub fn with_processing_poll(self, every: Duration) -> Self
Set processing_poll.
Sourcepub fn with_dsp_sched(self, sched: DspSchedConfig) -> Self
pub fn with_dsp_sched(self, sched: DspSchedConfig) -> Self
Set dsp_sched.