[−][src]Struct audio_duration::AudioDuration
Implementations
impl AudioDuration
[src]
pub fn new(samples: u64, sampling_frequency: u32) -> AudioDuration
[src]
Make a new AudioDuration
.
pub fn samples(&self) -> u64
[src]
Return the number of samples in this AudioDuration
.
pub fn set_samples(&mut self, samples: u64)
[src]
Set the samples for this AudioDuration
.
pub fn sampling_frequency(&self) -> u32
[src]
Return the sampling frequency of this AudioDuration
.
pub fn as_secs(&self) -> u64
[src]
Return the whole number of seconds in this AudioDuration
.
pub fn as_mins(&self) -> u64
[src]
Return the whole number of minutes in this AudioDuration
.
pub fn as_hours(&self) -> u64
[src]
Return the whole number of hours in this AudioDuration
.
pub fn as_days(&self) -> u64
[src]
Return the whole number of days in this AudioDuration
.
pub fn as_weeks(&self) -> u64
[src]
Return the whole number of weeks in this AudioDuration
.
pub fn subsec_samples(&self) -> u32
[src]
Return the fractional part of this AudioDuration
in samples.
This will return a value in the range 0 <= subsec_samples < sampling_frequency
.
pub fn subsec_nanos(&self) -> u32
[src]
Return the fractional part of this AudioDuration
as a whole
number of nanoseconds.
pub fn subsec_secs(&self) -> f64
[src]
Return the fractional part of this AudioDuration
as seconds.
This will return a value in the range 0.0 <= subsec_secs < 1.0
.
pub fn submin_secs(&self) -> u64
[src]
Return the fractional part of minutes in seconds.
pub fn subhour_mins(&self) -> u64
[src]
Return the fractional part of hours in minutes.
pub fn subday_hours(&self) -> u64
[src]
Return the fractional part of days in hours.
pub fn subweek_days(&self) -> u64
[src]
Return the fractional part of days in hours.
pub fn duration(&self) -> Duration
[src]
Return this AudioDuration
as a Duration.
pub fn fmt_hhmmss_samples(&self) -> String
[src]
Return the duration as a String
formatted as hh:mm:ss;samples
.
pub fn fmt_hhmmss(&self) -> String
[src]
Return the duration as a String
formatted as hh:mm:ss
.
pub fn fmt_opt_hh_mmss(&self) -> String
[src]
Return the duration formatted as mm:ss
if the duration is
less than an hour, as hh:mm:ss
otherwise.
Trait Implementations
impl Display for AudioDuration
[src]
impl Into<Duration> for AudioDuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for AudioDuration
impl Send for AudioDuration
impl Sync for AudioDuration
impl Unpin for AudioDuration
impl UnwindSafe for AudioDuration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,