Type Definition fermium::audio::SDL_AudioCallback
source · pub type SDL_AudioCallback = Option<unsafe extern "C" fn(userdata: *mut c_void, stream: *mut u8, len: c_int)>;
Expand description
This function is called when the audio device needs more data.
userdata
An application-specific parameter saved in theSDL_AudioSpec
structurestream
A pointer to the audio data buffer.len
The length of that buffer in bytes.
The buffer is uninitialized when the callback is called.
The callback must initialize the entire buffer.
Once the callback returns, the buffer will no longer be valid.
See SDL_AudioSpec
for default sample ordering.
You can choose to avoid callbacks and use SDL_QueueAudio() instead, if you like. Just open your audio device with a NULL callback.