home *** CD-ROM | disk | FTP | other *** search
- <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
- <!-- available at http://polyglotman.sourceforge.net/ -->
-
- <html>
- <head>
- <title>"SDL_LoadWAV"("3") manual page</title>
- </head>
- <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
- <a href='#toc'>Table of Contents</a><p>
-
- <h2><a name='sect0' href='#toc0'>Name</a></h2>
- SDL_LoadWAV- Load a WAVE file
- <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
- <p>
- <b>#include "SDL.h" <p>
- </b><b>SDL_AudioSpec
- *<b>SDL_LoadWAV</b></b>(<b>const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf,
- Uint32 *audio_len</b>);
- <h2><a name='sect2' href='#toc2'>Description</a></h2>
- <p>
- <b>SDL_LoadWAV</b> This function loads a WAVE <b>file</b>
- into memory. <p>
- If this function succeeds, it returns the given <i><b>SDL_AudioSpec</b></i>,
- filled with the audio data format of the wave data, and sets <b>audio_buf</b>
- to a <b>malloc</b>'d buffer containing the audio data, and sets <b>audio_len</b> to the
- length of that audio buffer, in bytes. You need to free the audio buffer
- with <i><b>SDL_FreeWAV</b></i> when you are done with it. <p>
- This function returns <b>NULL</b> and
- sets the SDL error message if the wave file cannot be opened, uses an unknown
- data format, or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files
- are supported.
- <h2><a name='sect3' href='#toc3'>Example</a></h2>
- <p>
- <br>
- <pre>CWSDL_AudioSpec wav_spec;
- Uint32 wav_length;
- Uint8 *wav_buffer;
- /* Load the WAV */
- if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){
- fprintf(stderr, "Could not open test.wav: %s
- ", SDL_GetError());
- exit(-1);
- }
- .
- .
- .
- /* Do stuff with the WAV */
- .
- .
- /* Free It */
- SDL_FreeWAV(wav_buffer);
- </pre><p>
-
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_AudioSpec</b></i>, <i><b>SDL_OpenAudio</b></i>, <i><b>SDL_FreeWAV</b></i>
- <!--
-
- <p>
-
- <hr><p>
- <a name='toc'><b>Table of Contents</b></a><p>
- <ul>
- <li><a name='toc0' href='#sect0'>Name</a></li>
- <li><a name='toc1' href='#sect1'>Synopsis</a></li>
- <li><a name='toc2' href='#sect2'>Description</a></li>
- <li><a name='toc3' href='#sect3'>Example</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-