pub struct AudioRenderCapacity { /* private fields */ }
Expand description
Provider for rendering performance metrics
A load value is computed for each system-level audio callback, by dividing its execution duration by the system-level audio callback buffer size divided by the sample rate.
Ideally the load value is below 1.0, meaning that it took less time to render the audio than it took to play it out. An audio buffer underrun happens when this load value is greater than 1.0: the system could not render audio fast enough for real-time.
Implementations§
Source§impl AudioRenderCapacity
impl AudioRenderCapacity
Sourcepub fn start(&self, options: AudioRenderCapacityOptions)
pub fn start(&self, options: AudioRenderCapacityOptions)
Start metric collection and analysis
Sourcepub fn set_onupdate<F: FnMut(AudioRenderCapacityEvent) + Send + 'static>(
&self,
callback: F,
)
pub fn set_onupdate<F: FnMut(AudioRenderCapacityEvent) + Send + 'static>( &self, callback: F, )
The EventHandler for AudioRenderCapacityEvent
.
Only a single event handler is active at any time. Calling this method multiple times will override the previous event handler.
Sourcepub fn clear_onupdate(&self)
pub fn clear_onupdate(&self)
Unset the EventHandler for AudioRenderCapacityEvent
.
Trait Implementations§
Source§impl Clone for AudioRenderCapacity
impl Clone for AudioRenderCapacity
Source§fn clone(&self) -> AudioRenderCapacity
fn clone(&self) -> AudioRenderCapacity
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AudioRenderCapacity
impl RefUnwindSafe for AudioRenderCapacity
impl Send for AudioRenderCapacity
impl Sync for AudioRenderCapacity
impl Unpin for AudioRenderCapacity
impl UnwindSafe for AudioRenderCapacity
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