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>
impl<'a> MutableBorrowedAudioBuffer<'a>
Sourcepub fn slice_frames(
buffer: &'a mut dyn AudioBuffer,
frame_offset: usize,
frame_count: usize,
) -> Self
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
Sourcepub fn slice_channels(
buffer: &'a mut dyn AudioBuffer,
channel_offset: usize,
channel_count: usize,
) -> Self
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
Sourcepub fn slice_channels_and_frames(
buffer: &'a mut dyn AudioBuffer,
frame_count: usize,
channel_count: usize,
) -> Self
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
Sourcepub fn slice(buffer: &'a mut dyn AudioBuffer, range: SampleRange) -> Self
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<'_>
impl AudioBuffer for MutableBorrowedAudioBuffer<'_>
Source§fn channel_count(&self) -> usize
fn channel_count(&self) -> usize
Get the number of channels in this buffer
Source§fn frame_count(&self) -> usize
fn frame_count(&self) -> usize
Get the number of frames in this buffer
Source§fn sample_rate(&self) -> usize
fn sample_rate(&self) -> usize
Get the sample rate of this buffer
Source§fn get_channel_data(&self, sample_location: SampleLocation) -> &[f32]
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]
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,
)
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,
)
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,
)
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
fn length_in_seconds(&self) -> f64
Get the length represented by this buffer in seconds
Source§fn range_is_valid(&self, range: &SampleRange) -> bool
fn range_is_valid(&self, range: &SampleRange) -> bool
Verify that a sample range is valid
Source§fn clear_range(&mut self, range: &SampleRange)
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)
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)
fn fill_with_value(&mut self, value: f32)
Fill the entire buffer with a value
Source§fn set_sample(&mut self, sample_location: SampleLocation, value: f32)
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)
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
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,
)
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,
)
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,
)
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)
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])
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)
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
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,
)
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)
fn fill_from_slice(&mut self, audio_data: &[f32], location: SampleLocation)
Fill a channel from a slice
Auto Trait Implementations§
impl<'a> Freeze for MutableBorrowedAudioBuffer<'a>
impl<'a> !RefUnwindSafe for MutableBorrowedAudioBuffer<'a>
impl<'a> !Send for MutableBorrowedAudioBuffer<'a>
impl<'a> !Sync for MutableBorrowedAudioBuffer<'a>
impl<'a> Unpin for MutableBorrowedAudioBuffer<'a>
impl<'a> !UnwindSafe for MutableBorrowedAudioBuffer<'a>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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 moreSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.