pub struct HardwareParameters { /* private fields */ }Expand description
The HardwareParameters struct configures the format requested from an audio device.
Implementations§
Source§impl HardwareParameters
impl HardwareParameters
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates parameters for 48 kHz, stereo, 16-bit playback.
§Defaults
- Sample rate: 48,000 Hz
- Channels: 2
- Bit depth: 16
pub fn sample_rate(self, sample_rate: u32) -> Self
pub fn channels(self, channels: u32) -> Self
pub fn bit_depth(self, bit_depth: u32) -> Self
pub fn get_sample_rate(&self) -> u32
pub fn get_channels(&self) -> u32
pub fn get_bit_depth(&self) -> u32
Trait Implementations§
Source§impl Clone for HardwareParameters
impl Clone for HardwareParameters
impl Copy for HardwareParameters
Source§impl Debug for HardwareParameters
impl Debug for HardwareParameters
Source§impl Default for HardwareParameters
impl Default for HardwareParameters
impl Eq for HardwareParameters
Source§impl Hash for HardwareParameters
impl Hash for HardwareParameters
Source§impl PartialEq for HardwareParameters
impl PartialEq for HardwareParameters
impl StructuralPartialEq for HardwareParameters
Auto Trait Implementations§
impl Freeze for HardwareParameters
impl RefUnwindSafe for HardwareParameters
impl Send for HardwareParameters
impl Sync for HardwareParameters
impl Unpin for HardwareParameters
impl UnsafeUnpin for HardwareParameters
impl UnwindSafe for HardwareParameters
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