pub struct AudioMode {
pub sample_rate: NonZero<u32>,
pub channels: NonZero<u8>,
pub sample_format: AudioSampleFormat,
}Expand description
Audio monitor output mode.
Fields§
§sample_rate: NonZero<u32>The no. of samples per second per channel.
channels: NonZero<u8>The no. of audio channels.
sample_format: AudioSampleFormatSample format.
Implementations§
Source§impl AudioMode
impl AudioMode
pub const fn new( sample_rate: u32, channels: u8, sample_format: AudioSampleFormat, ) -> Result<AudioMode, ()>
Sourcepub fn frame_size(self) -> u16
pub fn frame_size(self) -> u16
Returns the size of an audio frame in bytes.
Sourcepub const fn bytes_per_second(&self) -> NonZero<u64>
pub const fn bytes_per_second(&self) -> NonZero<u64>
Returns the audio stream throughput in B/s.
Trait Implementations§
impl Copy for AudioMode
impl Eq for AudioMode
impl StructuralPartialEq for AudioMode
Auto Trait Implementations§
impl Freeze for AudioMode
impl RefUnwindSafe for AudioMode
impl Send for AudioMode
impl Sync for AudioMode
impl Unpin for AudioMode
impl UnsafeUnpin for AudioMode
impl UnwindSafe for AudioMode
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