pub struct Frame {
pub samples: StackVec<f32, bbx_dsp::::frame::Frame::{constant#0}>,
pub sample_rate: u32,
pub num_channels: usize,
}Expand description
A frame of audio data for visualization or inter-thread communication.
Uses stack-allocated storage for realtime-safe operation on audio threads.
Fields§
§samples: StackVec<f32, bbx_dsp::::frame::Frame::{constant#0}>Interleaved audio samples (stack-allocated).
sample_rate: u32Sample rate in Hz.
num_channels: usizeNumber of audio channels.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn channel_samples(
&self,
channel: usize,
) -> Option<impl Iterator<Item = f32>>
pub fn channel_samples( &self, channel: usize, ) -> Option<impl Iterator<Item = f32>>
Returns an iterator over samples for a specific channel (de-interleaved).
Returns None if the channel index is out of bounds.
Sourcepub fn samples_per_channel(&self) -> usize
pub fn samples_per_channel(&self) -> usize
Get the number of samples per channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
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