.\" 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_mixer's wiki page for Mix_LoadWAV_IO: .\" https://wiki.libsdl.org/SDL_mixer/Mix_LoadWAV_IO .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision 3~git20240319~12fb85e+ds-1 .\" 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%20Mix_LoadWAV_IO .\" SDL_mixer can be found at https://libsdl.org/projects/SDL_mixer .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH Mix_LoadWAV_IO 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS" .SH NAME Mix_LoadWAV_IO \- Load a supported audio format into a chunk\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_mixer/SDL_mixer.h\(dq .PP .BI "Mix_Chunk * Mix_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio); .fi .SH DESCRIPTION SDL_mixer has two separate data structures for audio data\[char46] One it calls a "chunk," which is meant to be a file completely decoded into memory up front, and the other it calls "music" which is a file intended to be decoded on demand\[char46] Originally, simple formats like uncompressed WAV files were meant to be chunks and compressed things, like MP3s, were meant to be music, and you would stream one thing for a game's music and make repeating sound effects with the chunks\[char46] In modern times, this isn't split by format anymore, and most are interchangeable, so the question is what the app thinks is worth predecoding or not\[char46] Chunks might take more memory, but once they are loaded won't need to decode again, whereas music always needs to be decoded on the fly\[char46] Also, crucially, there are as many channels for chunks as the app can allocate, but SDL_mixer only offers a single "music" channel\[char46] If .BR closeio is SDL_TRUE, the IOStream will be closed before returning, whether this function succeeds or not\[char46] SDL_mixer reads everything it needs from the IOStream during this call in any case\[char46] There is a separate function (a macro, before SDL_mixer 3\[char46]0\[char46]0) to read files from disk without having to deal with SDL_IOStream: .BR Mix_LoadWAV("filename\[char46]wav") will call this function and manage those details for you\[char46] When done with a chunk, the app should dispose of it with a call to .BR Mix_FreeChunk ()\[char46] .SH FUNCTION PARAMETERS .TP .I src an SDL_IOStream that data will be read from\[char46] .TP .I closeio SDL_TRUE to close the SDL_IOStream before returning, SDL_FALSE to leave it open\[char46] .SH RETURN VALUE Returns a new chunk, or NULL on error\[char46] .SH AVAILABILITY This function is available since SDL_mixer 3\[char46]0\[char46]0 .SH SEE ALSO .BR Mix_LoadWAV (3), .BR Mix_FreeChunk (3)