[−][src]Function sdl2_sys::SDL_LoadWAV_RW
pub unsafe extern "C" fn SDL_LoadWAV_RW(
src: *mut SDL_RWops,
freesrc: c_int,
spec: *mut SDL_AudioSpec,
audio_buf: *mut *mut Uint8,
audio_len: *mut Uint32
) -> *mut SDL_AudioSpec
This function loads a WAVE from the data source, automatically freeing that source if \c freesrc is non-zero. For example, to load a WAVE file, you could do: \code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); \endcode
If this function succeeds, it returns the given SDL_AudioSpec, filled with the audio data format of the wave data, and sets \c *audio_buf to a malloc()'d buffer containing the audio data, and sets \c *audio_len to the length of that audio buffer, in bytes. You need to free the audio buffer with SDL_FreeWAV() when you are done with it.
This function returns NULL and sets the SDL error message if the wave file cannot be opened, uses an unknown data format, or is corrupt. Currently raw and MS-ADPCM WAVE files are supported.