pub struct Frames(pub u64);Expand description
Unit of time length (of a single de-interleaved channel) in samples.
Tuple Fields§
§0: u64Implementations§
Source§impl Frames
impl Frames
pub fn new(frames: u64) -> Self
Sourcepub fn to_seconds(&self, sample_rate: SampleRate) -> Seconds
pub fn to_seconds(&self, sample_rate: SampleRate) -> Seconds
Convert to the corresponding time in Seconds with the given SampleRate.
Note that this conversion is NOT lossless.
Sourcepub fn to_musical(&self, bpm: f64, sample_rate: SampleRate) -> MusicalTime
pub fn to_musical(&self, bpm: f64, sample_rate: SampleRate) -> MusicalTime
Convert to the corresponding MusicalTime.
Note that this conversion is NOT lossless.
Note that this must be re-calculated after recieving a new SampleRate.
Sourcepub fn to_super_frames(&self, sample_rate: SampleRate) -> SuperFrames
pub fn to_super_frames(&self, sample_rate: SampleRate) -> SuperFrames
Convert to the corresponding time length in SuperFrames from the given SampleRate.
This conversion IS lossless if the sample rate happens to be equal to one of the common
sample rates: 22050, 24000, 44100, 48000, 88200, 96000, 176400, or 192000. This
conversion is NOT lossless otherwise.
Trait Implementations§
Source§impl AddAssign for Frames
impl AddAssign for Frames
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl MulAssign<u64> for Frames
impl MulAssign<u64> for Frames
Source§fn mul_assign(&mut self, other: u64)
fn mul_assign(&mut self, other: u64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Frames
impl PartialOrd for Frames
Source§impl SubAssign for Frames
impl SubAssign for Frames
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl Copy for Frames
impl Eq for Frames
impl StructuralPartialEq for Frames
Auto Trait Implementations§
impl Freeze for Frames
impl RefUnwindSafe for Frames
impl Send for Frames
impl Sync for Frames
impl Unpin for Frames
impl UnwindSafe for Frames
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