#[non_exhaustive]pub struct SpeakerConfig {
pub sample_rate: u32,
pub channels: u16,
pub device: DeviceSelector,
}Expand description
Configuration for audio output.
#[non_exhaustive]: construct it with SpeakerConfig::default and then
assign the public fields you need. Direct struct-literal construction from
another crate is intentionally not supported, so adding a field later stays
backward compatible.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sample_rate: u32Sample rate in Hz. Range: 1000–384000. Default: 16000.
channels: u16Number of output channels. Range: 1–32. Default: 1.
device: DeviceSelectorDevice selection. Default: system default output.
Implementations§
Source§impl SpeakerConfig
impl SpeakerConfig
Sourcepub fn validate(&self) -> Result<(), DecibriError>
pub fn validate(&self) -> Result<(), DecibriError>
Validate the configuration: sample rate and channel count must fall within the supported ranges.
Trait Implementations§
Source§impl Clone for SpeakerConfig
impl Clone for SpeakerConfig
Source§fn clone(&self) -> SpeakerConfig
fn clone(&self) -> SpeakerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpeakerConfig
impl Debug for SpeakerConfig
Auto Trait Implementations§
impl Freeze for SpeakerConfig
impl RefUnwindSafe for SpeakerConfig
impl Send for SpeakerConfig
impl Sync for SpeakerConfig
impl Unpin for SpeakerConfig
impl UnsafeUnpin for SpeakerConfig
impl UnwindSafe for SpeakerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more