pub struct DspContext {
pub sample_rate: f64,
pub num_channels: usize,
pub buffer_size: usize,
pub current_sample: u64,
pub channel_layout: ChannelLayout,
}Expand description
Runtime context passed to blocks during audio processing.
Contains the audio specification (sample rate, channels, buffer size) and
the current playback position. This context is passed to every block’s
process() method, allowing time-dependent calculations.
Fields§
§sample_rate: f64The audio sample rate in Hz (e.g., 44100.0, 48000.0).
num_channels: usizeThe number of output channels (e.g., 2 for stereo).
buffer_size: usizeThe number of samples processed per block.
current_sample: u64The absolute sample position since playback started.
Increments by buffer_size after each process cycle.
channel_layout: ChannelLayoutThe channel layout for audio processing. Describes the speaker/channel configuration (stereo, surround, ambisonics).
Trait Implementations§
Source§impl Clone for DspContext
impl Clone for DspContext
Source§fn clone(&self) -> DspContext
fn clone(&self) -> DspContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DspContext
impl RefUnwindSafe for DspContext
impl Send for DspContext
impl Sync for DspContext
impl Unpin for DspContext
impl UnwindSafe for DspContext
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