1<HTML 2><HEAD 3><TITLE 4>Audio</TITLE 5><META 6NAME="GENERATOR" 7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ 8"><LINK 9REL="HOME" 10TITLE="SDL Library Documentation" 11HREF="index.html"><LINK 12REL="UP" 13TITLE="SDL Reference" 14HREF="reference.html"><LINK 15REL="PREVIOUS" 16TITLE="SDL_JoystickClose" 17HREF="sdljoystickclose.html"><LINK 18REL="NEXT" 19TITLE="SDL_AudioSpec" 20HREF="sdlaudiospec.html"><META 21NAME="KEYWORD" 22CONTENT="audio"><META 23NAME="KEYWORD" 24CONTENT="function"></HEAD 25><BODY 26CLASS="CHAPTER" 27BGCOLOR="#FFF8DC" 28TEXT="#000000" 29LINK="#0000ee" 30VLINK="#551a8b" 31ALINK="#ff0000" 32><DIV 33CLASS="NAVHEADER" 34><TABLE 35SUMMARY="Header navigation table" 36WIDTH="100%" 37BORDER="0" 38CELLPADDING="0" 39CELLSPACING="0" 40><TR 41><TH 42COLSPAN="3" 43ALIGN="center" 44>SDL Library Documentation</TH 45></TR 46><TR 47><TD 48WIDTH="10%" 49ALIGN="left" 50VALIGN="bottom" 51><A 52HREF="sdljoystickclose.html" 53ACCESSKEY="P" 54>Prev</A 55></TD 56><TD 57WIDTH="80%" 58ALIGN="center" 59VALIGN="bottom" 60></TD 61><TD 62WIDTH="10%" 63ALIGN="right" 64VALIGN="bottom" 65><A 66HREF="sdlaudiospec.html" 67ACCESSKEY="N" 68>Next</A 69></TD 70></TR 71></TABLE 72><HR 73ALIGN="LEFT" 74WIDTH="100%"></DIV 75><DIV 76CLASS="CHAPTER" 77><H1 78><A 79NAME="AUDIO" 80></A 81>Chapter 10. Audio</H1 82><DIV 83CLASS="TOC" 84><DL 85><DT 86><B 87>Table of Contents</B 88></DT 89><DT 90><A 91HREF="sdlaudiospec.html" 92>SDL_AudioSpec</A 93> -- Audio Specification Structure</DT 94><DT 95><A 96HREF="sdlopenaudio.html" 97>SDL_OpenAudio</A 98> -- Opens the audio device with the desired parameters.</DT 99><DT 100><A 101HREF="sdlpauseaudio.html" 102>SDL_PauseAudio</A 103> -- Pauses and unpauses the audio callback processing</DT 104><DT 105><A 106HREF="sdlgetaudiostatus.html" 107>SDL_GetAudioStatus</A 108> -- Get the current audio state</DT 109><DT 110><A 111HREF="sdlloadwav.html" 112>SDL_LoadWAV</A 113> -- Load a WAVE file</DT 114><DT 115><A 116HREF="sdlfreewav.html" 117>SDL_FreeWAV</A 118> -- Frees previously opened WAV data</DT 119><DT 120><A 121HREF="sdlaudiocvt.html" 122>SDL_AudioCVT</A 123> -- Audio Conversion Structure</DT 124><DT 125><A 126HREF="sdlbuildaudiocvt.html" 127>SDL_BuildAudioCVT</A 128> -- Initializes a SDL_AudioCVT structure for conversion</DT 129><DT 130><A 131HREF="sdlconvertaudio.html" 132>SDL_ConvertAudio</A 133> -- Convert audio data to a desired audio format.</DT 134><DT 135><A 136HREF="sdlmixaudio.html" 137>SDL_MixAudio</A 138> -- Mix audio data</DT 139><DT 140><A 141HREF="sdllockaudio.html" 142>SDL_LockAudio</A 143> -- Lock out the callback function</DT 144><DT 145><A 146HREF="sdlunlockaudio.html" 147>SDL_UnlockAudio</A 148> -- Unlock the callback function</DT 149><DT 150><A 151HREF="sdlcloseaudio.html" 152>SDL_CloseAudio</A 153> -- Shuts down audio processing and closes the audio device.</DT 154></DL 155></DIV 156><P 157>Sound on the computer is translated from waves that you hear into a series of 158values, or samples, each representing the amplitude of the wave. When these 159samples are sent in a stream to a sound card, an approximation of the original 160wave can be recreated. The more bits used to represent the amplitude, and the 161greater frequency these samples are gathered, the closer the approximated 162sound is to the original, and the better the quality of sound.</P 163><P 164>This library supports both 8 and 16 bit signed and unsigned sound samples, 165at frequencies ranging from 11025 Hz to 44100 Hz, depending on the 166underlying hardware. If the hardware doesn't support the desired audio 167format or frequency, it can be emulated if desired (See 168<A 169HREF="sdlopenaudio.html" 170><TT 171CLASS="FUNCTION" 172>SDL_OpenAudio()</TT 173></A 174>)</P 175><P 176>A commonly supported audio format is 16 bits per sample at 22050 Hz.</P 177></DIV 178><DIV 179CLASS="NAVFOOTER" 180><HR 181ALIGN="LEFT" 182WIDTH="100%"><TABLE 183SUMMARY="Footer navigation table" 184WIDTH="100%" 185BORDER="0" 186CELLPADDING="0" 187CELLSPACING="0" 188><TR 189><TD 190WIDTH="33%" 191ALIGN="left" 192VALIGN="top" 193><A 194HREF="sdljoystickclose.html" 195ACCESSKEY="P" 196>Prev</A 197></TD 198><TD 199WIDTH="34%" 200ALIGN="center" 201VALIGN="top" 202><A 203HREF="index.html" 204ACCESSKEY="H" 205>Home</A 206></TD 207><TD 208WIDTH="33%" 209ALIGN="right" 210VALIGN="top" 211><A 212HREF="sdlaudiospec.html" 213ACCESSKEY="N" 214>Next</A 215></TD 216></TR 217><TR 218><TD 219WIDTH="33%" 220ALIGN="left" 221VALIGN="top" 222>SDL_JoystickClose</TD 223><TD 224WIDTH="34%" 225ALIGN="center" 226VALIGN="top" 227><A 228HREF="reference.html" 229ACCESSKEY="U" 230>Up</A 231></TD 232><TD 233WIDTH="33%" 234ALIGN="right" 235VALIGN="top" 236>SDL_AudioSpec</TD 237></TR 238></TABLE 239></DIV 240></BODY 241></HTML 242>