Struct sampler::audio::wav::Audio
[−]
[src]
pub struct Audio<F> { pub path: PathBuf, pub data: Box<[F]>, pub sample_hz: f64, }
WAV data loaded into memory as a single contiguous slice of PCM frames.
Fields
path: PathBuf
data: Box<[F]>
sample_hz: f64
Methods
impl<F> Audio<F> where
F: Frame,
F::Sample: Duplex<f64> + Duplex<i32>,
Box<[F::Sample]>: ToBoxedFrameSlice<F>,
[src]
F: Frame,
F::Sample: Duplex<f64> + Duplex<i32>,
Box<[F::Sample]>: ToBoxedFrameSlice<F>,
fn from_file<P>(path: P, target_sample_hz: f64) -> Result<Self, Error> where
P: AsRef<Path>,
P: AsRef<Path>,
Loads a Sample
from the .wav
file at the given path
.
The PCM data retrieved from the file will be: - re-sized from its source bit rate to that of the target and - re-sampled upon loading (rather than at playback) to the given target sample rate for efficiency.
Trait Implementations
impl<F: Clone> Clone for Audio<F>
[src]
fn clone(&self) -> Audio<F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<F: Debug> Debug for Audio<F>
[src]
impl<F: PartialEq> PartialEq for Audio<F>
[src]
fn eq(&self, __arg_0: &Audio<F>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Audio<F>) -> bool
This method tests for !=
.
impl<F> Audio for Audio<F> where
F: Frame,
[src]
F: Frame,