pub struct Pcm { /* private fields */ }Expand description
One owned mono PCM buffer.
Implementations§
Source§impl Pcm
impl Pcm
Sourcepub fn new(format: PcmFormat, samples: PcmSamples) -> Result<Self, PcmError>
pub fn new(format: PcmFormat, samples: PcmSamples) -> Result<Self, PcmError>
Pair a validated format with samples of the same depth.
§Errors
Returns PcmError::EncodingMismatch when the format and sample variant disagree.
Sourcepub const fn samples(&self) -> &PcmSamples
pub const fn samples(&self) -> &PcmSamples
The owned sample representation.
Sourcepub fn into_samples(self) -> PcmSamples
pub fn into_samples(self) -> PcmSamples
Consume the buffer and return its samples.
Trait Implementations§
impl Eq for Pcm
impl StructuralPartialEq for Pcm
Auto Trait Implementations§
impl Freeze for Pcm
impl RefUnwindSafe for Pcm
impl Send for Pcm
impl Sync for Pcm
impl Unpin for Pcm
impl UnsafeUnpin for Pcm
impl UnwindSafe for Pcm
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