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<ReaderFactoryCallback>,
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<ReaderFactoryCallback>§state: ProcessingState§sample_rate: f32§current_time: f64§current_frame: Tick§muted: boolImplementations§
Source§impl AudioRenderThread
impl AudioRenderThread
Sourcefn prepare_thread<B: AudioBackend>(
sender: Sender<AudioRenderThreadMsg>,
sample_rate: f32,
graph: AudioGraph,
options: AudioContextOptions,
) -> Result<Self, AudioSinkError>
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!
Sourcepub fn start<B: AudioBackend>(
event_queue: Receiver<AudioRenderThreadMsg>,
sender: Sender<AudioRenderThreadMsg>,
sample_rate: f32,
graph: AudioGraph,
options: AudioContextOptions,
init_sender: Sender<Result<(), AudioSinkError>>,
)
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
fn resume(&mut self) -> StateChangeResult
fn suspend(&mut self) -> StateChangeResult
fn create_node( &mut self, node_type: AudioNodeInit, ch: ChannelInfo, ) -> Option<NodeId>
fn connect_ports( &mut self, output: PortId<OutputPort>, input: PortId<InputPort>, )
fn process(&mut self) -> Chunk
fn set_mute(&mut self, val: bool)
fn event_loop(&mut self, event_queue: Receiver<AudioRenderThreadMsg>)
Auto Trait Implementations§
impl !Freeze for AudioRenderThread
impl !RefUnwindSafe for AudioRenderThread
impl !Send for AudioRenderThread
impl !Sync for AudioRenderThread
impl Unpin for AudioRenderThread
impl UnsafeUnpin for AudioRenderThread
impl !UnwindSafe for AudioRenderThread
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert