MutableBorrowedAudioBuffer

Struct MutableBorrowedAudioBuffer 

Source
pub struct MutableBorrowedAudioBuffer<'a> { /* private fields */ }
Expand description

A mutable buffer that refers to a portion of another buffer

Implementations§

Source§

impl<'a> MutableBorrowedAudioBuffer<'a>

Source

pub fn slice_frames( buffer: &'a mut dyn AudioBuffer, frame_offset: usize, frame_count: usize, ) -> Self

Create a slice of another audio buffer with a subset of frames

Source

pub fn slice_channels( buffer: &'a mut dyn AudioBuffer, channel_offset: usize, channel_count: usize, ) -> Self

Create a slice of another audio buffer with a subset of channels

Source

pub fn slice_channels_and_frames( buffer: &'a mut dyn AudioBuffer, frame_count: usize, channel_count: usize, ) -> Self

Create a slice of another audio buffer with a subset of channels and frames

Source

pub fn slice(buffer: &'a mut dyn AudioBuffer, range: SampleRange) -> Self

Create a slice of another audio buffer with a subset of channels and frames

Trait Implementations§

Source§

impl AudioBuffer for MutableBorrowedAudioBuffer<'_>

Source§

fn channel_count(&self) -> usize

Get the number of channels in this buffer
Source§

fn frame_count(&self) -> usize

Get the number of frames in this buffer
Source§

fn sample_rate(&self) -> usize

Get the sample rate of this buffer
Source§

fn get_channel_data(&self, sample_location: SampleLocation) -> &[f32]

Get a slice representing the audio data of a particular channel
Source§

fn get_channel_data_mut( &mut self, sample_location: SampleLocation, ) -> &mut [f32]

Get a mutable slice representing the audio data of a particular channel
Source§

fn duplicate_channel( &mut self, source: SampleLocation, to_channel: usize, frame_count: usize, )

Duplicate the audio data from one channel to a different channel
Source§

fn fill_from_interleaved( &mut self, interleaved_data: &[f32], channel_count: usize, frame_count: usize, )

Fill the buffer with interleaved audio Read more
Source§

fn copy_to_interleaved( &self, interleaved_data: &mut [f32], channel_count: usize, frame_count: usize, )

Copy the data to an interleaved buffer Read more
Source§

fn length_in_seconds(&self) -> f64

Get the length represented by this buffer in seconds
Source§

fn duration(&self) -> Duration

Get the duration of this buffer in seconds
Source§

fn clear(&mut self)

Clear the audio in this buffer
Source§

fn range_is_valid(&self, range: &SampleRange) -> bool

Verify that a sample range is valid
Source§

fn clear_range(&mut self, range: &SampleRange)

Clear the audio in a range of samples
Source§

fn fill_channel_with_value(&mut self, channel: usize, value: f32)

Fill a channel with a value
Source§

fn fill_with_value(&mut self, value: f32)

Fill the entire buffer with a value
Source§

fn channel_is_silent(&self, channel: usize) -> bool

Check if a channel is silent Read more
Source§

fn set_sample(&mut self, sample_location: SampleLocation, value: f32)

Set a sample in the buffer
Source§

fn add_sample(&mut self, sample_location: SampleLocation, value: f32)

Add a sample into the buffer
Source§

fn get_sample(&self, sample_location: SampleLocation) -> f32

Get a sample from the buffer
Source§

fn add_from( &mut self, source_buffer: &dyn AudioBuffer, source_location: SampleLocation, destination_location: SampleLocation, channel_count: usize, frame_count: usize, )

Mix audio from one buffer into another buffer
Source§

fn add_from_with_gain( &mut self, source_buffer: &dyn AudioBuffer, source_location: SampleLocation, destination_location: SampleLocation, channel_count: usize, frame_count: usize, gain: f32, )

Mix audio from one buffer into another buffer, apply a constant gain to each sample
Source§

fn copy_from( &mut self, source_buffer: &dyn AudioBuffer, source_location: SampleLocation, destination_location: SampleLocation, channel_count: usize, frame_count: usize, )

Copy audio from one buffer into another Read more
Source§

fn copy_within(&mut self, source_range: &SampleRange, destination_frame: usize)

Copy audio data within the buffer
Source§

fn apply_gain(&mut self, gain: &[f32])

Apply gain to all channels the buffer Read more
Source§

fn apply_gain_value(&mut self, range: &SampleRange, gain: f32)

Apply a single gain value to a whole channel
Source§

fn frame_iter(&self) -> FrameIterator

Get an iterator to iteraotr over every sample in the buffer Read more
Source§

fn sample_rate_convert_from( &mut self, audio_buffer: &dyn AudioBuffer, source_location: SampleLocation, destination_location: SampleLocation, channel_count: usize, )

Copy audio from a different audio buffer at a different sample rate Read more
Source§

fn fill_from_slice(&mut self, audio_data: &[f32], location: SampleLocation)

Fill a channel from a slice

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.