Type Alias DefaultBackend
pub type DefaultBackend = CpalBackend;
Available on crate feature
dep_kira
only.Expand description
The default backend used by AudioManager
s.
If the cpal
feature is enabled, this will be the cpal backend. Otherwise,
it will be the mock backend.
Aliased Type§
struct DefaultBackend { /* private fields */ }
Implementations
§impl CpalBackend
impl CpalBackend
pub fn pop_cpu_usage(&mut self) -> Option<f32> ⓘ
pub fn pop_cpu_usage(&mut self) -> Option<f32> ⓘ
Returns the oldest reported CPU usage in the queue.
The formula for the CPU usage is time elapsed / time allotted, where
- time elapsed is the amount of time it took to fill the audio buffer requested by the OS
- time allotted is the maximum amount of time Kira could take to process audio and still finish in time to avoid audio stuttering (num frames / sample rate)
Trait Implementations
§impl Backend for CpalBackend
impl Backend for CpalBackend
§type Settings = CpalBackendSettings
type Settings = CpalBackendSettings
Settings for this backend.
§fn setup(
settings: <CpalBackend as Backend>::Settings,
_internal_buffer_size: usize,
) -> Result<(CpalBackend, u32), <CpalBackend as Backend>::Error> ⓘ
fn setup( settings: <CpalBackend as Backend>::Settings, _internal_buffer_size: usize, ) -> Result<(CpalBackend, u32), <CpalBackend as Backend>::Error> ⓘ
Starts the backend and returns itself and the initial sample rate.