pub struct AudioBuffer {
pub samples: [f32; 512],
pub len: usize,
}Expand description
Fixed-size mono audio buffer.
Fields§
§samples: [f32; 512]§len: usizeImplementations§
Source§impl AudioBuffer
impl AudioBuffer
pub fn new() -> Self
pub fn silence() -> Self
pub fn fill(&mut self, v: f32)
pub fn add_from(&mut self, other: &AudioBuffer)
pub fn multiply_by(&mut self, other: &AudioBuffer)
pub fn scale(&mut self, gain: f32)
pub fn mix(&mut self, other: &AudioBuffer, weight: f32)
pub fn peak(&self) -> f32
pub fn rms(&self) -> f32
Trait Implementations§
Source§impl Clone for AudioBuffer
impl Clone for AudioBuffer
Source§fn clone(&self) -> AudioBuffer
fn clone(&self) -> AudioBuffer
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 moreSource§impl Debug for AudioBuffer
impl Debug for AudioBuffer
Auto Trait Implementations§
impl Freeze for AudioBuffer
impl RefUnwindSafe for AudioBuffer
impl Send for AudioBuffer
impl Sync for AudioBuffer
impl Unpin for AudioBuffer
impl UnsafeUnpin for AudioBuffer
impl UnwindSafe for AudioBuffer
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