pub struct Audio { /* private fields */ }
Expand description
Audio data.
Implementations§
source§impl Audio
impl Audio
sourcepub fn retain_channels(&mut self, filter: impl FnMut(usize) -> bool)
pub fn retain_channels(&mut self, filter: impl FnMut(usize) -> bool)
Only retain specified channels in self
.
sourcepub fn sample_rate(&self) -> F
pub fn sample_rate(&self) -> F
Sample rate.
sourcepub fn from_interleaved(
sample_rate: F,
channels: usize,
data: impl IntoIterator<Item = impl Into<F>>
) -> Self
pub fn from_interleaved( sample_rate: F, channels: usize, data: impl IntoIterator<Item = impl Into<F>> ) -> Self
Create Self from interleaved sample.
sourcepub fn from_channels(
sample_rate: F,
channels: impl IntoIterator<Item = impl IntoIterator<Item = impl Into<F>>>
) -> Self
pub fn from_channels( sample_rate: F, channels: impl IntoIterator<Item = impl IntoIterator<Item = impl Into<F>>> ) -> Self
Create Self from individual channels of audio data.
sourcepub fn to_interleaved<T: FromPrimitive>(&self) -> impl Iterator<Item = T> + '_
pub fn to_interleaved<T: FromPrimitive>(&self) -> impl Iterator<Item = T> + '_
Return samples in interleaved form.
Trait Implementations§
source§impl ApproxEq for &Audio
impl ApproxEq for &Audio
§type Margin = F64Margin
type Margin = F64Margin
This type type defines a margin within which two values are to be
considered approximately equal. It must implement
Default
so that
approx_eq()
can be called on unknown types.source§impl PartialEq<Audio> for Audio
impl PartialEq<Audio> for Audio
impl StructuralPartialEq for Audio
Auto Trait Implementations§
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnwindSafe for Audio
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
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.