Skip to main content

CoreAudioRenderBridge

Struct CoreAudioRenderBridge 

Source
pub struct CoreAudioRenderBridge<P> { /* private fields */ }
Expand description

Drives a processor from a CoreAudio render callback.

Implementations§

Source§

impl<P: Processor> CoreAudioRenderBridge<P>

Source

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.

Source

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.

Source

pub fn sample_pos(&self) -> u64

Returns the running sample position, in frames rendered so far.

Source

pub fn timing(&self) -> CoreAudioTiming

Returns the timing configuration this bridge was built with.

Source

pub fn reset(&mut self)

Resets the wrapped processor, the sample position, and the scratch arena.

Trait Implementations§

Source§

impl<P: Debug> Debug for CoreAudioRenderBridge<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P> Freeze for CoreAudioRenderBridge<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for CoreAudioRenderBridge<P>
where P: RefUnwindSafe,

§

impl<P> Send for CoreAudioRenderBridge<P>
where P: Send,

§

impl<P> Sync for CoreAudioRenderBridge<P>
where P: Sync,

§

impl<P> Unpin for CoreAudioRenderBridge<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for CoreAudioRenderBridge<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for CoreAudioRenderBridge<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.