pub struct AudioBuffer {
pub number_channels: u32,
pub data_bytes_size: u32,
/* private fields */
}Expand description
Raw audio buffer containing sample data
An AudioBuffer represents a single channel or interleaved audio data.
Access the raw bytes via data() or data_mut().
Fields§
§number_channels: u32Number of audio channels in this buffer
data_bytes_size: u32Size of the audio data in bytes
Implementations§
Source§impl AudioBuffer
impl AudioBuffer
Sourcepub fn data_mut(&mut self) -> &mut [u8] ⓘ
pub fn data_mut(&mut self) -> &mut [u8] ⓘ
Get the raw audio data as a mutable byte slice
§Warning
This returns a &mut [u8] that points directly into the CoreMedia block
buffer backing the captured sample. That memory may be aliased with the
still-live source CMSampleBuffer (and any other copies of the underlying
CMBlockBuffer), so mutating it can race with or corrupt data observed
elsewhere. Only mutate this slice if you are certain no other reader holds a
view into the same block buffer, and never mutate it concurrently. Prefer
copying the bytes out via data() when in doubt.
Sourcepub fn data_byte_size(&self) -> usize
pub fn data_byte_size(&self) -> usize
Get the size of the data in bytes