pub struct AudioFormatSpec {
pub sample_rate: u32,
pub channels: u16,
pub frame_samples: Option<usize>,
}Expand description
Data type for audio format spec.
Fields§
§sample_rate: u32Sample rate in hertz.
channels: u16Number of audio channels.
frame_samples: Option<usize>The frame samples value.
Implementations§
Source§impl AudioFormatSpec
impl AudioFormatSpec
Sourcepub fn frame_samples(self, frame_samples: usize) -> Result<Self>
pub fn frame_samples(self, frame_samples: usize) -> Result<Self>
Returns frame samples.
Sourcepub fn duration_seconds(&self, samples_per_channel: usize) -> Result<f64>
pub fn duration_seconds(&self, samples_per_channel: usize) -> Result<f64>
Returns duration seconds.
Trait Implementations§
Source§impl Clone for AudioFormatSpec
impl Clone for AudioFormatSpec
Source§fn clone(&self) -> AudioFormatSpec
fn clone(&self) -> AudioFormatSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AudioFormatSpec
Source§impl Debug for AudioFormatSpec
impl Debug for AudioFormatSpec
impl Eq for AudioFormatSpec
Source§impl PartialEq for AudioFormatSpec
impl PartialEq for AudioFormatSpec
Source§fn eq(&self, other: &AudioFormatSpec) -> bool
fn eq(&self, other: &AudioFormatSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AudioFormatSpec
Auto Trait Implementations§
impl Freeze for AudioFormatSpec
impl RefUnwindSafe for AudioFormatSpec
impl Send for AudioFormatSpec
impl Sync for AudioFormatSpec
impl Unpin for AudioFormatSpec
impl UnsafeUnpin for AudioFormatSpec
impl UnwindSafe for AudioFormatSpec
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