docs/html/sdlloadwav.html
changeset 3352 6dc250ebdd80
parent 3351 8e0182c236d8
child 3353 6b14223dd5c7
     1.1 --- a/docs/html/sdlloadwav.html	Wed Oct 07 06:11:53 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,296 +0,0 @@
     1.4 -<HTML
     1.5 -><HEAD
     1.6 -><TITLE
     1.7 ->SDL_LoadWAV</TITLE
     1.8 -><META
     1.9 -NAME="GENERATOR"
    1.10 -CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
    1.11 -"><LINK
    1.12 -REL="HOME"
    1.13 -TITLE="SDL Library Documentation"
    1.14 -HREF="index.html"><LINK
    1.15 -REL="UP"
    1.16 -TITLE="Audio"
    1.17 -HREF="audio.html"><LINK
    1.18 -REL="PREVIOUS"
    1.19 -TITLE="SDL_GetAudioStatus"
    1.20 -HREF="sdlgetaudiostatus.html"><LINK
    1.21 -REL="NEXT"
    1.22 -TITLE="SDL_FreeWAV"
    1.23 -HREF="sdlfreewav.html"></HEAD
    1.24 -><BODY
    1.25 -CLASS="REFENTRY"
    1.26 -BGCOLOR="#FFF8DC"
    1.27 -TEXT="#000000"
    1.28 -LINK="#0000ee"
    1.29 -VLINK="#551a8b"
    1.30 -ALINK="#ff0000"
    1.31 -><DIV
    1.32 -CLASS="NAVHEADER"
    1.33 -><TABLE
    1.34 -SUMMARY="Header navigation table"
    1.35 -WIDTH="100%"
    1.36 -BORDER="0"
    1.37 -CELLPADDING="0"
    1.38 -CELLSPACING="0"
    1.39 -><TR
    1.40 -><TH
    1.41 -COLSPAN="3"
    1.42 -ALIGN="center"
    1.43 ->SDL Library Documentation</TH
    1.44 -></TR
    1.45 -><TR
    1.46 -><TD
    1.47 -WIDTH="10%"
    1.48 -ALIGN="left"
    1.49 -VALIGN="bottom"
    1.50 -><A
    1.51 -HREF="sdlgetaudiostatus.html"
    1.52 -ACCESSKEY="P"
    1.53 ->Prev</A
    1.54 -></TD
    1.55 -><TD
    1.56 -WIDTH="80%"
    1.57 -ALIGN="center"
    1.58 -VALIGN="bottom"
    1.59 -></TD
    1.60 -><TD
    1.61 -WIDTH="10%"
    1.62 -ALIGN="right"
    1.63 -VALIGN="bottom"
    1.64 -><A
    1.65 -HREF="sdlfreewav.html"
    1.66 -ACCESSKEY="N"
    1.67 ->Next</A
    1.68 -></TD
    1.69 -></TR
    1.70 -></TABLE
    1.71 -><HR
    1.72 -ALIGN="LEFT"
    1.73 -WIDTH="100%"></DIV
    1.74 -><H1
    1.75 -><A
    1.76 -NAME="SDLLOADWAV"
    1.77 -></A
    1.78 ->SDL_LoadWAV</H1
    1.79 -><DIV
    1.80 -CLASS="REFNAMEDIV"
    1.81 -><A
    1.82 -NAME="AEN6816"
    1.83 -></A
    1.84 -><H2
    1.85 ->Name</H2
    1.86 ->SDL_LoadWAV&nbsp;--&nbsp;Load a WAVE file</DIV
    1.87 -><DIV
    1.88 -CLASS="REFSYNOPSISDIV"
    1.89 -><A
    1.90 -NAME="AEN6819"
    1.91 -></A
    1.92 -><H2
    1.93 ->Synopsis</H2
    1.94 -><DIV
    1.95 -CLASS="FUNCSYNOPSIS"
    1.96 -><A
    1.97 -NAME="AEN6820"
    1.98 -></A
    1.99 -><P
   1.100 -></P
   1.101 -><PRE
   1.102 -CLASS="FUNCSYNOPSISINFO"
   1.103 ->#include "SDL.h"</PRE
   1.104 -><P
   1.105 -><CODE
   1.106 -><CODE
   1.107 -CLASS="FUNCDEF"
   1.108 ->SDL_AudioSpec *<B
   1.109 -CLASS="FSFUNC"
   1.110 ->SDL_LoadWAV</B
   1.111 -></CODE
   1.112 ->(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);</CODE
   1.113 -></P
   1.114 -><P
   1.115 -></P
   1.116 -></DIV
   1.117 -></DIV
   1.118 -><DIV
   1.119 -CLASS="REFSECT1"
   1.120 -><A
   1.121 -NAME="AEN6826"
   1.122 -></A
   1.123 -><H2
   1.124 ->Description</H2
   1.125 -><P
   1.126 -><TT
   1.127 -CLASS="FUNCTION"
   1.128 ->SDL_LoadWAV</TT
   1.129 ->
   1.130 -This function loads a WAVE <TT
   1.131 -CLASS="PARAMETER"
   1.132 -><I
   1.133 ->file</I
   1.134 -></TT
   1.135 -> into memory.</P
   1.136 -><P
   1.137 ->If this function succeeds, it returns the given 
   1.138 -<A
   1.139 -HREF="sdlaudiospec.html"
   1.140 -><TT
   1.141 -CLASS="FUNCTION"
   1.142 ->SDL_AudioSpec</TT
   1.143 -></A
   1.144 ->, 
   1.145 -filled with the audio data format of the wave data, and sets 
   1.146 -<TT
   1.147 -CLASS="PARAMETER"
   1.148 -><I
   1.149 ->audio_buf</I
   1.150 -></TT
   1.151 -> to a <TT
   1.152 -CLASS="FUNCTION"
   1.153 ->malloc</TT
   1.154 ->'d 
   1.155 -buffer containing the audio data, and sets <TT
   1.156 -CLASS="PARAMETER"
   1.157 -><I
   1.158 ->audio_len</I
   1.159 -></TT
   1.160 -> 
   1.161 -to the length of that audio buffer, in bytes.  You need to free the audio 
   1.162 -buffer with <A
   1.163 -HREF="sdlfreewav.html"
   1.164 -><TT
   1.165 -CLASS="FUNCTION"
   1.166 ->SDL_FreeWAV</TT
   1.167 -></A
   1.168 -> when you are
   1.169 -done with it.</P
   1.170 -><P
   1.171 ->This function returns <TT
   1.172 -CLASS="LITERAL"
   1.173 ->NULL</TT
   1.174 -> and sets the SDL 
   1.175 -error message if the wave file cannot be opened, uses an unknown data format, 
   1.176 -or is corrupt.  Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.</P
   1.177 -></DIV
   1.178 -><DIV
   1.179 -CLASS="REFSECT1"
   1.180 -><A
   1.181 -NAME="AEN6841"
   1.182 -></A
   1.183 -><H2
   1.184 ->Example</H2
   1.185 -><PRE
   1.186 -CLASS="PROGRAMLISTING"
   1.187 ->SDL_AudioSpec wav_spec;
   1.188 -Uint32 wav_length;
   1.189 -Uint8 *wav_buffer;
   1.190 -
   1.191 -/* Load the WAV */
   1.192 -if( SDL_LoadWAV("test.wav", &#38;wav_spec, &#38;wav_buffer, &#38;wav_length) == NULL ){
   1.193 -  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
   1.194 -  exit(-1);
   1.195 -}
   1.196 -.
   1.197 -.
   1.198 -.
   1.199 -/* Do stuff with the WAV */
   1.200 -.
   1.201 -.
   1.202 -/* Free It */
   1.203 -SDL_FreeWAV(wav_buffer);</PRE
   1.204 -></DIV
   1.205 -><DIV
   1.206 -CLASS="REFSECT1"
   1.207 -><A
   1.208 -NAME="AEN6844"
   1.209 -></A
   1.210 -><H2
   1.211 ->See Also</H2
   1.212 -><P
   1.213 -><A
   1.214 -HREF="sdlaudiospec.html"
   1.215 -><SPAN
   1.216 -CLASS="STRUCTNAME"
   1.217 ->SDL_AudioSpec</SPAN
   1.218 -></A
   1.219 ->,
   1.220 -<A
   1.221 -HREF="sdlopenaudio.html"
   1.222 -><TT
   1.223 -CLASS="FUNCTION"
   1.224 ->SDL_OpenAudio</TT
   1.225 -></A
   1.226 ->,
   1.227 -<A
   1.228 -HREF="sdlfreewav.html"
   1.229 -><TT
   1.230 -CLASS="FUNCTION"
   1.231 ->SDL_FreeWAV</TT
   1.232 -></A
   1.233 -></P
   1.234 -></DIV
   1.235 -><DIV
   1.236 -CLASS="NAVFOOTER"
   1.237 -><HR
   1.238 -ALIGN="LEFT"
   1.239 -WIDTH="100%"><TABLE
   1.240 -SUMMARY="Footer navigation table"
   1.241 -WIDTH="100%"
   1.242 -BORDER="0"
   1.243 -CELLPADDING="0"
   1.244 -CELLSPACING="0"
   1.245 -><TR
   1.246 -><TD
   1.247 -WIDTH="33%"
   1.248 -ALIGN="left"
   1.249 -VALIGN="top"
   1.250 -><A
   1.251 -HREF="sdlgetaudiostatus.html"
   1.252 -ACCESSKEY="P"
   1.253 ->Prev</A
   1.254 -></TD
   1.255 -><TD
   1.256 -WIDTH="34%"
   1.257 -ALIGN="center"
   1.258 -VALIGN="top"
   1.259 -><A
   1.260 -HREF="index.html"
   1.261 -ACCESSKEY="H"
   1.262 ->Home</A
   1.263 -></TD
   1.264 -><TD
   1.265 -WIDTH="33%"
   1.266 -ALIGN="right"
   1.267 -VALIGN="top"
   1.268 -><A
   1.269 -HREF="sdlfreewav.html"
   1.270 -ACCESSKEY="N"
   1.271 ->Next</A
   1.272 -></TD
   1.273 -></TR
   1.274 -><TR
   1.275 -><TD
   1.276 -WIDTH="33%"
   1.277 -ALIGN="left"
   1.278 -VALIGN="top"
   1.279 ->SDL_GetAudioStatus</TD
   1.280 -><TD
   1.281 -WIDTH="34%"
   1.282 -ALIGN="center"
   1.283 -VALIGN="top"
   1.284 -><A
   1.285 -HREF="audio.html"
   1.286 -ACCESSKEY="U"
   1.287 ->Up</A
   1.288 -></TD
   1.289 -><TD
   1.290 -WIDTH="33%"
   1.291 -ALIGN="right"
   1.292 -VALIGN="top"
   1.293 ->SDL_FreeWAV</TD
   1.294 -></TR
   1.295 -></TABLE
   1.296 -></DIV
   1.297 -></BODY
   1.298 -></HTML
   1.299 ->
   1.300 \ No newline at end of file