# QuickReference If you want to paste this into a text editor that can't handle the fancy Unicode section headers, try using [QuickReferenceNoUnicode](QuickReferenceNoUnicode) instead. ```c // SDL3_sound API Quick Reference // // https://icculus.org/SDL_sound/ // // The latest version of this document can be found at https://wiki.libsdl.org/SDL3_sound/QuickReference // Based on SDL_sound version 3.0.0 // // This can be useful in an IDE with search and syntax highlighting. // // Original idea for this document came from Dan Bechard (thanks!) // ASCII art generated by: https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow (with modified 'S' for readability) // ██████╗ ██████╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ███╗ ██╗ ██████╗ // ██╔════╝ ██╔══██╗ ██║ ██╔════╝ ██╔═══██╗ ██║ ██║ ████╗ ██║ ██╔══██╗ // ███████╗ ██║ ██║ ██║ ███████╗ ██║ ██║ ██║ ██║ ██╔██╗ ██║ ██║ ██║ // ╚════██║ ██║ ██║ ██║ ╚════██║ ██║ ██║ ██║ ██║ ██║╚██╗██║ ██║ ██║ // ██████╔╝ ██████╔╝ ███████╗ ██████╔╝ ╚██████╔╝ ╚██████╔╝ ██║ ╚████║ ██████╔╝ // ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ #define SDL_SOUND_MAJOR_VERSION // The current major version of the SDL_sound headers. #define SDL_SOUND_MINOR_VERSION // The current minor version of the SDL_sound headers. #define SDL_SOUND_MICRO_VERSION // The current micro (or patchlevel) version of the SDL_sound headers. #define SDL_SOUND_VERSION // This is the version number macro for the current SDL_sound version. #define SDL_SOUND_VERSION_ATLEAST(X, Y, Z) // This macro will evaluate to true if compiled with SDL_net at least X.Y.Z. int Sound_Version(void); // This function gets the version of the dynamically linked SDL_sound library. int Sound_Init(void); // Initialize SDL_sound. int Sound_Quit(void); // Shutdown SDL_sound. const Sound_DecoderInfo ** Sound_AvailableDecoders(void); // Get a list of sound formats supported by this version of SDL_sound. const char * Sound_GetError(void); // Get the last SDL_sound error message as a null-terminated string. void Sound_ClearError(void); // Clear the current error message. Sound_Sample * Sound_NewSample(SDL_IOStream *io, const char *ext, const SDL_AudioSpec *desired, Uint32 bufferSize); // Start decoding a new sound sample. Sound_Sample * Sound_NewSampleFromMem(const Uint8 *data, Uint32 size, const char *ext, const SDL_AudioSpec *desired, Uint32 bufferSize); // Start decoding a new sound sample from a file on disk. Sound_Sample * Sound_NewSampleFromFile(const char *filename, const SDL_AudioSpec *desired, Uint32 bufferSize); // Start decoding a new sound sample from a file on disk. void Sound_FreeSample(Sound_Sample *sample); // Dispose of a Sound_Sample. Sint32 Sound_GetDuration(Sound_Sample *sample); // Retrieve total play time of sample, in milliseconds. int Sound_SetBufferSize(Sound_Sample *sample, Uint32 new_size); // Change the current buffer size for a sample. Uint32 Sound_Decode(Sound_Sample *sample); // Decode more of the sound data in a Sound_Sample. Uint32 Sound_DecodeAll(Sound_Sample *sample); // Decode the remainder of the sound data in a Sound_Sample. int Sound_Rewind(Sound_Sample *sample); // Rewind a sample to the start. int Sound_Seek(Sound_Sample *sample, Uint32 ms); // Seek to a different point in a sample. ```