pub struct DecodedAudio {
pub samples: Vec<f32>,
pub sample_rate: u32,
pub channels: u32,
pub duration: f32,
}Expand description
Decoded audio data
Fields§
§samples: Vec<f32>§sample_rate: u32§channels: u32§duration: f32Implementations§
Source§impl DecodedAudio
impl DecodedAudio
Sourcepub fn new(samples: Vec<f32>, sample_rate: u32, channels: u32) -> Self
pub fn new(samples: Vec<f32>, sample_rate: u32, channels: u32) -> Self
Create new decoded audio
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Get total sample count
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get frame count (samples per channel)
Sourcepub fn to_i16_samples(&self) -> Vec<i16>
pub fn to_i16_samples(&self) -> Vec<i16>
Convert to interleaved i16 samples
Sourcepub fn to_i32_samples(&self) -> Vec<i32>
pub fn to_i32_samples(&self) -> Vec<i32>
Convert to interleaved i32 samples
Trait Implementations§
Source§impl Clone for DecodedAudio
impl Clone for DecodedAudio
Source§fn clone(&self) -> DecodedAudio
fn clone(&self) -> DecodedAudio
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DecodedAudio
impl RefUnwindSafe for DecodedAudio
impl Send for DecodedAudio
impl Sync for DecodedAudio
impl Unpin for DecodedAudio
impl UnwindSafe for DecodedAudio
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more