pub struct SoundBuffer {
pub sample_rate: u32,
pub samples: Vec<f32>,
}Expand description
A mono PCM buffer in -1..=1 floats — the backend-agnostic sound
asset the crate::AudioOut trait registers.
Fields§
§sample_rate: u32Samples per second.
samples: Vec<f32>Mono samples, -1..=1.
Implementations§
Trait Implementations§
Source§impl Clone for SoundBuffer
impl Clone for SoundBuffer
Source§fn clone(&self) -> SoundBuffer
fn clone(&self) -> SoundBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SoundBuffer
impl Debug for SoundBuffer
Source§impl PartialEq for SoundBuffer
impl PartialEq for SoundBuffer
Source§fn eq(&self, other: &SoundBuffer) -> bool
fn eq(&self, other: &SoundBuffer) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SoundBuffer
Auto Trait Implementations§
impl Freeze for SoundBuffer
impl RefUnwindSafe for SoundBuffer
impl Send for SoundBuffer
impl Sync for SoundBuffer
impl Unpin for SoundBuffer
impl UnsafeUnpin for SoundBuffer
impl UnwindSafe for SoundBuffer
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