Type Alias DefaultBackend

pub type DefaultBackend = CpalBackend;
Available on crate feature dep_kira only.
Expand description

The default backend used by AudioManagers.

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

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

§

type Settings = CpalBackendSettings

Settings for this backend.
§

type Error = Error

Errors that can occur when using this backend.
§

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.
§

fn start( &mut self, renderer: Renderer, ) -> Result<(), <CpalBackend as Backend>::Error>

Sends the renderer to the backend to start audio playback.
§

impl Drop for CpalBackend

§

fn drop(&mut self)

Executes the destructor for this type. Read more