pub enum GenericAudioBufferRef<'a> {
U8(&'a AudioBuffer<u8>),
U16(&'a AudioBuffer<u16>),
U24(&'a AudioBuffer<u24>),
U32(&'a AudioBuffer<u32>),
S8(&'a AudioBuffer<i8>),
S16(&'a AudioBuffer<i16>),
S24(&'a AudioBuffer<i24>),
S32(&'a AudioBuffer<i32>),
F32(&'a AudioBuffer<f32>),
F64(&'a AudioBuffer<f64>),
}Expand description
A non-owning immutable reference wrapper for an AudioBuffer of any standard sample format.
Calls on this wrapper are dispatched to the underlying, wrapped, buffer and are semantically identical.
Variants§
U8(&'a AudioBuffer<u8>)
An immutable unsigned 8-bit integer audio buffer reference.
U16(&'a AudioBuffer<u16>)
An immutable unsigned 16-bit integer audio buffer reference.
U24(&'a AudioBuffer<u24>)
An immutable unsigned 24-bit integer audio buffer reference.
U32(&'a AudioBuffer<u32>)
An immutable unsigned 32-bit integer audio buffer reference.
S8(&'a AudioBuffer<i8>)
An immutable signed 8-bit integer audio buffer reference.
S16(&'a AudioBuffer<i16>)
An immutable signed 16-bit integer audio buffer reference.
S24(&'a AudioBuffer<i24>)
An immutable signed 24-bit integer audio buffer reference.
S32(&'a AudioBuffer<i32>)
An immutable signed 32-bit integer audio buffer reference.
F32(&'a AudioBuffer<f32>)
An immutable single precision (32-bit) floating point audio buffer reference.
F64(&'a AudioBuffer<f64>)
An immutable double precision (64-bit) floating point audio buffer reference.
Implementations§
Source§impl GenericAudioBufferRef<'_>
impl GenericAudioBufferRef<'_>
Sourcepub fn num_planes(&self) -> usize
pub fn num_planes(&self) -> usize
Get the total number of audio planes.
Sourcepub fn is_unused(&self) -> bool
pub fn is_unused(&self) -> bool
Returns true if the referenced AudioBuffer is unused.
An unused AudioBuffer has either a capacity of 0, or no channels.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Gets the total capacity of the buffer. The capacity is the maximum number of audio frames the buffer can store.
Sourcepub fn samples_interleaved(&self) -> usize
pub fn samples_interleaved(&self) -> usize
Get the total number of samples contained in all audio planes.
Sourcepub fn samples_planar(&self) -> usize
pub fn samples_planar(&self) -> usize
Get the total number of samples contained in each audio plane.
Sourcepub fn copy_to<Sout, Dst>(&self, dst: &mut Dst)where
Sout: ConvertibleSample,
Dst: AudioMut<Sout>,
pub fn copy_to<Sout, Dst>(&self, dst: &mut Dst)where
Sout: ConvertibleSample,
Dst: AudioMut<Sout>,
Copy audio to a mutable audio slice while doing any necessary sample format conversions.
Sourcepub fn copy_to_slice_interleaved<Sout, Dst>(&self, dst: Dst)
pub fn copy_to_slice_interleaved<Sout, Dst>(&self, dst: Dst)
Copy all audio frames to a slice of samples in interleaved order.
See AudioBuffer::copy_to_slice_interleaved for full details.
Sourcepub fn copy_to_slice_planar<Sout, Dst>(&self, dst: &mut [Dst])
pub fn copy_to_slice_planar<Sout, Dst>(&self, dst: &mut [Dst])
Copy all audio planes to discrete slices.
See AudioBuffer::copy_to_slice_planar for full details.
Sourcepub fn copy_to_vec_interleaved<Sout>(&self, dst: &mut Vec<Sout>)where
Sout: ConvertibleSample,
pub fn copy_to_vec_interleaved<Sout>(&self, dst: &mut Vec<Sout>)where
Sout: ConvertibleSample,
Copy all audio frames to a vector of samples in interleaved order.
See AudioBuffer::copy_to_vec_interleaved for full details.
Sourcepub fn copy_to_vecs_planar<Sout>(&self, dst: &mut Vec<Vec<Sout>>)where
Sout: ConvertibleSample,
pub fn copy_to_vecs_planar<Sout>(&self, dst: &mut Vec<Vec<Sout>>)where
Sout: ConvertibleSample,
Copy all audio planes to discrete vectors.
See AudioBuffer::copy_to_vecs_planar for full details.
Sourcepub fn copy_bytes_interleaved_as<Sout, Dst>(&self, dst: Dst)
pub fn copy_bytes_interleaved_as<Sout, Dst>(&self, dst: Dst)
Copy interleaved audio to the destination byte slice after converting to a different sample format.
See AudioBuffer::copy_bytes_interleaved_as for full details.
Sourcepub fn copy_bytes_planar_as<Sout, Dst>(&self, dst: &mut [Dst])
pub fn copy_bytes_planar_as<Sout, Dst>(&self, dst: &mut [Dst])
Copy planar audio as bytes to a destination slice per plane after converting to a different sample format.
See AudioBuffer::copy_bytes_planar_as for full details.
Sourcepub fn copy_bytes_interleaved<Dst>(&self, dst: Dst)
pub fn copy_bytes_interleaved<Dst>(&self, dst: Dst)
Copy interleaved audio to the destination byte slice.
See AudioBuffer::copy_bytes_interleaved for full details.
Sourcepub fn copy_bytes_planar<Dst>(&self, dst: &mut [Dst])
pub fn copy_bytes_planar<Dst>(&self, dst: &mut [Dst])
Copy planar audio as bytes to a destination slice per plane.
See AudioBuffer::copy_bytes_planar for full details.
Sourcepub fn copy_bytes_to_vec_interleaved(&self, dst: &mut Vec<u8>)
pub fn copy_bytes_to_vec_interleaved(&self, dst: &mut Vec<u8>)
Copy interleaved audio to the destination byte vector.
See AudioBuffer::copy_bytes_to_vec_interleaved for full details.
Sourcepub fn copy_bytes_to_vec_interleaved_as<Sout>(&self, dst: &mut Vec<u8>)where
Sout: SampleBytes + ConvertibleSample,
pub fn copy_bytes_to_vec_interleaved_as<Sout>(&self, dst: &mut Vec<u8>)where
Sout: SampleBytes + ConvertibleSample,
Copy interleaved audio to the destination byte vector after converting to a different sample format.
See AudioBuffer::copy_bytes_to_vec_interleaved_as for full details.
Sourcepub fn copy_bytes_to_vecs_planar(&self, dst: &mut Vec<Vec<u8>>)
pub fn copy_bytes_to_vecs_planar(&self, dst: &mut Vec<Vec<u8>>)
Copy audio planes as bytes to discrete byte vectors.
See AudioBuffer::copy_bytes_to_vecs_planar for full details.
Sourcepub fn copy_bytes_to_vecs_planar_as<Sout>(&self, dst: &mut Vec<Vec<u8>>)where
Sout: SampleBytes + ConvertibleSample,
pub fn copy_bytes_to_vecs_planar_as<Sout>(&self, dst: &mut Vec<Vec<u8>>)where
Sout: SampleBytes + ConvertibleSample,
Copy audio planes as bytes to discrete byte vectors after converting to a different sample format.
See AudioBuffer::copy_bytes_to_vecs_planar_as for full details.
Sourcepub fn byte_len_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
pub fn byte_len_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
Get the length in bytes of all samples if converted to a new sample format.
Sourcepub fn byte_len_per_plane_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
pub fn byte_len_per_plane_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
Get the length in bytes of all samples in a single plane if converted to a new sample format.
Sourcepub fn byte_len_per_frame_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
pub fn byte_len_per_frame_as<Sout>(&self) -> usizewhere
Sout: SampleBytes + ConvertibleSample,
Get the length of bytes of a single interleaved audio frame if converted to a new sample format.
Sourcepub fn byte_len_per_plane(&self) -> usize
pub fn byte_len_per_plane(&self) -> usize
Get the length in bytes of all samples in a single plane.
Sourcepub fn byte_len_per_frame(&self) -> usize
pub fn byte_len_per_frame(&self) -> usize
Get the length of bytes of a single interleaved audio frame.
Trait Implementations§
Source§impl<'a> Clone for GenericAudioBufferRef<'a>
impl<'a> Clone for GenericAudioBufferRef<'a>
Source§fn clone(&self) -> GenericAudioBufferRef<'a>
fn clone(&self) -> GenericAudioBufferRef<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more