pub struct AudioDuration { /* private fields */ }Implementations§
Source§impl AudioDuration
impl AudioDuration
Sourcepub fn new(samples: u64, sampling_frequency: u32) -> AudioDuration
pub fn new(samples: u64, sampling_frequency: u32) -> AudioDuration
Make a new AudioDuration.
Sourcepub fn set_samples(&mut self, samples: u64)
pub fn set_samples(&mut self, samples: u64)
Set the samples for this AudioDuration.
Sourcepub fn sampling_frequency(&self) -> u32
pub fn sampling_frequency(&self) -> u32
Return the sampling frequency of this AudioDuration.
Sourcepub fn subsec_samples(&self) -> u32
pub fn subsec_samples(&self) -> u32
Return the fractional part of this AudioDuration in samples.
This will return a value in the range 0 <= subsec_samples < sampling_frequency.
Sourcepub fn subsec_nanos(&self) -> u32
pub fn subsec_nanos(&self) -> u32
Return the fractional part of this AudioDuration as a whole
number of nanoseconds.
Sourcepub fn subsec_secs(&self) -> f64
pub fn subsec_secs(&self) -> f64
Return the fractional part of this AudioDuration as seconds.
This will return a value in the range 0.0 <= subsec_secs < 1.0.
Sourcepub fn submin_secs(&self) -> u64
pub fn submin_secs(&self) -> u64
Return the fractional part of minutes in seconds.
Sourcepub fn subhour_mins(&self) -> u64
pub fn subhour_mins(&self) -> u64
Return the fractional part of hours in minutes.
Sourcepub fn subday_hours(&self) -> u64
pub fn subday_hours(&self) -> u64
Return the fractional part of days in hours.
Sourcepub fn subweek_days(&self) -> u64
pub fn subweek_days(&self) -> u64
Return the fractional part of days in hours.
Sourcepub fn fmt_hhmmss_samples(&self) -> String
pub fn fmt_hhmmss_samples(&self) -> String
Return the duration as a String formatted as hh:mm:ss;samples.
Sourcepub fn fmt_hhmmss(&self) -> String
pub fn fmt_hhmmss(&self) -> String
Return the duration as a String formatted as hh:mm:ss.
Sourcepub fn fmt_opt_hh_mmss(&self) -> String
pub fn fmt_opt_hh_mmss(&self) -> String
Return the duration formatted as mm:ss if the duration is
less than an hour, as hh:mm:ss otherwise.