pub struct AudioConfig {
pub sample_rate: u32,
pub channels: u8,
pub format: SampleFormat,
pub buffer_frames: u32,
}Expand description
Audio stream configuration
Fields§
§sample_rate: u32Sample rate in Hz (e.g., 44100, 48000)
channels: u8Number of audio channels (1 = mono, 2 = stereo)
format: SampleFormatSample format
buffer_frames: u32Number of frames per buffer period
Implementations§
Source§impl AudioConfig
impl AudioConfig
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create a default stereo 16-bit 48kHz configuration
Sourcepub fn frame_size(&self) -> u16
pub fn frame_size(&self) -> u16
Calculate the size of a single frame in bytes (channels * sample_size)
Trait Implementations§
Source§impl Clone for AudioConfig
impl Clone for AudioConfig
Source§fn clone(&self) -> AudioConfig
fn clone(&self) -> AudioConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioConfig
impl Debug for AudioConfig
impl Copy for AudioConfig
Auto Trait Implementations§
impl Freeze for AudioConfig
impl RefUnwindSafe for AudioConfig
impl Send for AudioConfig
impl Sync for AudioConfig
impl Unpin for AudioConfig
impl UnwindSafe for AudioConfig
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)