#[non_exhaustive]pub struct PcmFormat {
pub rate: u32,
pub channels: Channels,
}Expand description
The rate and channels of some samples.
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.rate: u32Frames a second.
channels: ChannelsHow many samples a frame has.
Implementations§
Source§impl PcmFormat
impl PcmFormat
Sourcepub fn new(rate: u32, channels: u32, limits: &Limits) -> Result<Self, Error>
pub fn new(rate: u32, channels: u32, limits: &Limits) -> Result<Self, Error>
rate and channels, if they are within limits.
Sourcepub fn samples_of(&self, frames: u64) -> Option<usize>
pub fn samples_of(&self, frames: u64) -> Option<usize>
How many samples frames frames are, if that fits.
Sourcepub fn millis_of(&self, frames: u64) -> Option<u64>
pub fn millis_of(&self, frames: u64) -> Option<u64>
How long frames frames play, in whole milliseconds rounded down, if
that fits.
Sourcepub fn frames_of_millis(&self, millis: u64) -> Option<u64>
pub fn frames_of_millis(&self, millis: u64) -> Option<u64>
How many whole frames play in millis milliseconds, if that fits.
Trait Implementations§
impl Copy for PcmFormat
impl Eq for PcmFormat
impl StructuralPartialEq for PcmFormat
Auto Trait Implementations§
impl Freeze for PcmFormat
impl RefUnwindSafe for PcmFormat
impl Send for PcmFormat
impl Sync for PcmFormat
impl Unpin for PcmFormat
impl UnsafeUnpin for PcmFormat
impl UnwindSafe for PcmFormat
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