pub struct AudioRenderThread {
    pub graph: AudioGraph,
    pub sink: Sink,
    pub sink_factory: Box<dyn Fn() -> Result<Box<dyn AudioSink + 'static>, AudioSinkError>>,
    pub reader_factory: Box<dyn Fn(MediaStreamId, f32) -> Box<dyn AudioStreamReader + Send>>,
    pub state: ProcessingState,
    pub sample_rate: f32,
    pub current_time: f64,
    pub current_frame: Tick,
    pub muted: bool,
}

Fields§

§graph: AudioGraph§sink: Sink§sink_factory: Box<dyn Fn() -> Result<Box<dyn AudioSink + 'static>, AudioSinkError>>§reader_factory: Box<dyn Fn(MediaStreamId, f32) -> Box<dyn AudioStreamReader + Send>>§state: ProcessingState§sample_rate: f32§current_time: f64§current_frame: Tick§muted: bool

Implementations§

source§

impl AudioRenderThread

source

fn prepare_thread<B: AudioBackend>( sender: Sender<AudioRenderThreadMsg>, sample_rate: f32, graph: AudioGraph, options: AudioContextOptions, ) -> Result<Self, AudioSinkError>

Initializes the AudioRenderThread object

You must call .event_loop() on this to run it!

source

pub fn start<B: AudioBackend>( event_queue: Receiver<AudioRenderThreadMsg>, sender: Sender<AudioRenderThreadMsg>, sample_rate: f32, graph: AudioGraph, options: AudioContextOptions, init_sender: Sender<Result<(), AudioSinkError>>, )

Start the audio render thread

In case something fails, it will instead start a thread with a dummy backend

source

fn resume(&mut self) -> StateChangeResult

source

fn suspend(&mut self) -> StateChangeResult

source

fn create_node(&mut self, node_type: AudioNodeInit, ch: ChannelInfo) -> NodeId

source

fn connect_ports( &mut self, output: PortId<OutputPort>, input: PortId<InputPort>, )

source

fn process(&mut self) -> Chunk

source

fn set_mute(&mut self, val: bool)

source

fn event_loop(&mut self, event_queue: Receiver<AudioRenderThreadMsg>)

Auto Trait Implementations§

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>,

§

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>,

§

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.