SDL_LoadWAV
Loads a WAV from a file path.
- Provided by: libsdl3-doc (Version: 3.2.20+ds-2)
- Source: libsdl3
- Report a bug
Loads a WAV from a file path.
#include <SDL3/SDL_audio.h>
bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
This is a convenience function that is effectively the same as:
SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), true, spec, audio_buf, audio_len);
for more information.
When the application is done with the data returned in audio_buf, it should call SDL_free() to dispose of it.
It is safe to call this function from any thread.
This function is available since SDL 3.2.0.