logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_LoadWAV - Loads a WAV from a file path.

Availability

       This function is available since SDL 3.2.0.

Description

       This is a convenience function that is effectively the same as:

              SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), true, spec, audio_buf, audio_len);

Function Parameters

path   the file path of the WAV file to open.

       spec   a  pointer  to  an  SDL_AudioSpec that will be set to the WAVE data's format details on successful
              return.

       audio_buf
              a pointer filled with the audio data, allocated by the function.

       audio_len
              a pointer filled with the length of the audio data buffer in bytes.

Name

       SDL_LoadWAV - Loads a WAV from a file path.

Return Value

       for more information.

       When the application is done with the data returned in audio_buf, it should call SDL_free() to dispose of
       it.

See Also

SDL_free(3), SDL_LoadWAV_IO(3)

Simple Directmedia Layer                           SDL 3.2.20                                     SDL_LoadWAV(3)

Synopsis

#include<SDL3/SDL_audio.h>boolSDL_LoadWAV(constchar*path,SDL_AudioSpec*spec,Uint8**audio_buf,Uint32*audio_len);

Thread Safety

       It is safe to call this function from any thread.

See Also