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_AudioSpec"("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_AudioSpec- Audio Specification Structure
- <h2><a name='sect1' href='#toc1'>Structure Definition</a></h2>
- <p>
- <br>
- <pre>CWtypedef struct{
- int freq;
- Uint16 format;
- Uint8 channels;
- Uint8 silence;
- Uint16 samples;
- Uint32 size;
- void (*callback)(void *userdata, Uint8 *stream, int len);
- void *userdata;
- } SDL_AudioSpec;
- </pre><p>
-
- <h2><a name='sect2' href='#toc2'>Structure Data</a></h2>
-
- <dl>
-
- <dt><b>freq</b> </dt>
- <dd>Audio frequency in samples per second </dd>
-
- <dt><b>format</b> </dt>
- <dd>Audio data
- format </dd>
-
- <dt><b>channels</b> </dt>
- <dd>Number of channels: 1 mono, 2 stereo </dd>
-
- <dt><b>silence</b> </dt>
- <dd>Audio buffer
- silence value (calculated) </dd>
-
- <dt><b>samples</b> </dt>
- <dd>Audio buffer size in samples </dd>
-
- <dt><b>size</b> </dt>
- <dd>Audio
- buffer size in bytes (calculated) </dd>
-
- <dt><b>callback(..)</b> </dt>
- <dd>Callback function for filling
- the audio buffer </dd>
-
- <dt><b>userdata</b> </dt>
- <dd>Pointer the user data which is passed to the
- callback function </dd>
- </dl>
-
- <h2><a name='sect3' href='#toc3'>Description</a></h2>
- <p>
- The <b>SDL_AudioSpec</b> structure is used to describe
- the format of some audio data. This structure is used by <i><b>SDL_OpenAudio</b></i> and
- <i><b>SDL_LoadWAV</b></i>. While all fields are used by <b>SDL_OpenAudio</b> only <b>freq</b>, <b>format</b>,
- <b>samples</b> and <b>channels</b> are used by <b>SDL_LoadWAV</b>. We will detail these common
- members here.
- <dl>
-
- <dt><b>freq</b> </dt>
- <dd>The number of samples sent to the sound device every
- second. Common values are 11025, 22050 and 44100. The higher the better. </dd>
-
- <dt><b>format</b>
- </dt>
- <dd>Specifies the size and type of each sample element </dd>
-
- <dt><b>AUDIO_U8</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_S8</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_U16</b>
- or <b>AUDIO_U16LSB</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_S16</b> or <b>AUDIO_S16LSB</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_U16MSB</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_S16MSB</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_U16SYS</b></dt>
- <dd></dd>
-
- <dt><b>AUDIO_S16SYS</b></dt>
- <dd></dd>
-
- <dt><b>channels</b>
- </dt>
- <dd>The number of seperate sound channels. 1 is mono (single channel), 2 is
- stereo (dual channel). </dd>
-
- <dt><b>samples</b> </dt>
- <dd>When used with <i><b>SDL_OpenAudio</b></i> this refers
- to the size of the audio buffer in samples. A sample a chunk of audio data
- of the size specified in <b>format</b> mulitplied by the number of channels. When
- the <b>SDL_AudioSpec</b> is used with <i><b>SDL_LoadWAV</b></i> <b>samples</b> is set to 4096. </dd>
- </dl>
-
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_OpenAudio</b></i>,
- <i><b>SDL_LoadWAV</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'>Structure Definition</a></li>
- <li><a name='toc2' href='#sect2'>Structure Data</a></li>
- <li><a name='toc3' href='#sect3'>Description</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-