pub struct AudioEngine { /* private fields */ }Expand description
The main audio engine. Owns the graph via ArcSwap for lock-free access.
Implementations§
Source§impl AudioEngine
impl AudioEngine
Sourcepub fn new(config: EngineConfig) -> Self
pub fn new(config: EngineConfig) -> Self
Create a new audio engine with the given configuration.
Sourcepub fn graph_handle(&self) -> Arc<ArcSwap<GraphSnapshot>>
pub fn graph_handle(&self) -> Arc<ArcSwap<GraphSnapshot>>
Get a handle for reading/swapping the graph from the main thread.
Sourcepub fn process(&mut self, frames: usize) -> &[f32]
pub fn process(&mut self, frames: usize) -> &[f32]
Process one block of audio. Called from the audio callback.
REAL-TIME SAFE: no allocations, no locks, no I/O. Returns a slice of f32 samples ready for cpal output.
Sourcepub fn limiter_gr_db(&self) -> f64
pub fn limiter_gr_db(&self) -> f64
Get the current gain reduction from the limiter (for metering).
Sourcepub fn config(&self) -> &EngineConfig
pub fn config(&self) -> &EngineConfig
Get the engine configuration.
Auto Trait Implementations§
impl !RefUnwindSafe for AudioEngine
impl !UnwindSafe for AudioEngine
impl Freeze for AudioEngine
impl Send for AudioEngine
impl Sync for AudioEngine
impl Unpin for AudioEngine
impl UnsafeUnpin for AudioEngine
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