.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_LoadWAV: .\" https://wiki.libsdl.org/SDL_LoadWAV .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_LoadWAV .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_LoadWAV 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_LoadWAV \- Loads a WAV from a file path\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_LoadWAV(const char *path, SDL_AudioSpec * spec, .BI " Uint8 ** audio_buf, Uint32 * audio_len); .fi .SH DESCRIPTION This is a convenience function that is effectively the same as: .BR .BR c SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len); .BR Note that in SDL2, this was a preprocessor macro and not a real function\[char46] .SH FUNCTION PARAMETERS .TP .I path The file path of the WAV file to open\[char46] .TP .I spec A pointer to an .BR SDL_AudioSpec that will be set to the WAVE data's format details on successful return\[char46] .TP .I audio_buf A pointer filled with the audio data, allocated by the function\[char46] .TP .I audio_len A pointer filled with the length of the audio data buffer in bytes .SH RETURN VALUE Returns This function, if successfully called, returns 0\[char46] .BR audio_buf will be filled with a pointer to an allocated buffer containing the audio data, and .BR audio_len is filled with the length of that audio buffer in bytes\[char46] This function returns -1 if the \[char46]WAV file cannot be opened, uses an unknown data format, or is corrupt; call .BR SDL_GetError () for more information\[char46] When the application is done with the data returned in .BR audio_buf , it should call .BR SDL_free () to dispose of it\[char46] .SH THREAD SAFETY It is safe to call this function from any thread\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_free (3), .BR SDL_LoadWAV_IO (3)