pub struct CoreAudioRenderBridge<P> { /* private fields */ }Expand description
Drives a processor from a CoreAudio render callback.
Implementations§
Source§impl<P: Processor> CoreAudioRenderBridge<P>
impl<P: Processor> CoreAudioRenderBridge<P>
Sourcepub fn new(
processor: P,
timing: CoreAudioTiming,
input_channels: usize,
output_channels: usize,
) -> Result<Self>
pub fn new( processor: P, timing: CoreAudioTiming, input_channels: usize, output_channels: usize, ) -> Result<Self>
Builds a render bridge wrapping processor for the given timing and
channel counts.
The processor is prepared immediately with a PrepareConfig derived
from timing, and a scratch BlockArena is sized for the largest
lane count. Returns an error when both channel counts are zero or when
the buffer/channel sizes exceed the kernel’s frame and channel widths.
Sourcepub fn render_planar_f32(
&mut self,
input: Option<&[&[f32]]>,
frames: usize,
) -> Result<Vec<Vec<f32>>>
pub fn render_planar_f32( &mut self, input: Option<&[&[f32]]>, frames: usize, ) -> Result<Vec<Vec<f32>>>
Runs one processing block of frames planar frames and returns the
rendered output lanes.
input supplies one slice per input channel; None substitutes silence.
The wrapped processor’s audio lanes are validated before and after the
call, and the bridge sample position advances by frames. Returns an
error when frames exceeds the prepared maximum block size or the input
lane shape does not match the configured channel count.
Sourcepub fn sample_pos(&self) -> u64
pub fn sample_pos(&self) -> u64
Returns the running sample position, in frames rendered so far.
Sourcepub fn timing(&self) -> CoreAudioTiming
pub fn timing(&self) -> CoreAudioTiming
Returns the timing configuration this bridge was built with.