AUDIO
Source snapshot · 12 October 2026

API reference / ravet_device::PreparedGraphOutput

Struct PreparedGraphOutput 

pub struct PreparedGraphOutput { /* private fields */ }
Expand description

Control-prepared f32 graph and worker scratch; new uses no input while with_input consumes an explicitly prepared input queue. Move this to an explicitly owned worker; start its non-Send session there and finish before returning it to main for graph/node retirement. No thread/device is created. Config requires matching input/output queue channels, zero aux buses, 0..1024 events per direction, 1..65536 frames, and producer-matching 1..64 channels. Scratch uses at most 32 MiB outside the graph’s own memory cap. Preparation consumes a fresh graph, preparing it once. Queue backpressure retains exact whole-frame suffixes without rerendering.

Implementations§

§

impl PreparedGraphOutput

pub fn new( graph: Box<Graph>, producer: AudioProducer, config: ProcessConfig, ) -> Result<Self, GraphOutputError>

pub fn with_input( graph: Box<Graph>, consumer: AudioConsumer, producer: AudioProducer, config: ProcessConfig, ) -> Result<Self, GraphOutputError>

Prepare queued f32 input and output with matching explicit graph/ring channels and rate policy. Input underflow fills zero; only fresh renders consume input, never retained output suffixes. No clocks/resampling/waits or devices are inferred. Combined worker scratch is capped at 32 MiB.

pub fn start_audio( &mut self, ) -> Result<GraphOutputSession<'_>, GraphOutputError>

Start this fixed graph on its explicit worker owner. Finish/drop before returning storage to main for graph/native retirement.

pub fn into_graph(self) -> Box<Graph>

Consume stopped worker storage on control. The caller retires the graph and separately retained native main controls; queued samples remain owned by the consumer until drain/drop. No automatic queue discard is implied.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.