AudioFillCallback

Type Alias AudioFillCallback 

Source
pub type AudioFillCallback = dyn Fn(&mut [f32], u32, u16) -> usize + Send + Sync;
Expand description

Callback function type for filling audio samples

The callback receives:

  • buffer: mutable slice to fill with audio samples
  • sample_rate: target sample rate for the samples
  • channels: number of audio channels

Returns the number of frames actually filled (frames = samples / channels)