home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_AudioSpec.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  3.3 KB  |  135 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_AudioSpec"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_AudioSpec- Audio Specification Structure 
  13. <h2><a name='sect1' href='#toc1'>Structure Definition</a></h2>
  14. <p>
  15. <br>
  16. <pre>CWtypedef struct{
  17.   int freq;
  18.   Uint16 format;
  19.   Uint8 channels;
  20.   Uint8 silence;
  21.   Uint16 samples;
  22.   Uint32 size;
  23.   void (*callback)(void *userdata, Uint8 *stream, int len);
  24.   void *userdata;
  25. } SDL_AudioSpec;
  26. </pre><p>
  27.  
  28. <h2><a name='sect2' href='#toc2'>Structure Data</a></h2>
  29.  
  30. <dl>
  31.  
  32. <dt><b>freq</b> </dt>
  33. <dd>Audio frequency in samples per second </dd>
  34.  
  35. <dt><b>format</b> </dt>
  36. <dd>Audio data
  37. format </dd>
  38.  
  39. <dt><b>channels</b> </dt>
  40. <dd>Number of channels: 1 mono, 2 stereo </dd>
  41.  
  42. <dt><b>silence</b> </dt>
  43. <dd>Audio buffer
  44. silence value (calculated) </dd>
  45.  
  46. <dt><b>samples</b> </dt>
  47. <dd>Audio buffer size in samples </dd>
  48.  
  49. <dt><b>size</b> </dt>
  50. <dd>Audio
  51. buffer size in bytes (calculated) </dd>
  52.  
  53. <dt><b>callback(..)</b> </dt>
  54. <dd>Callback function for filling
  55. the audio buffer </dd>
  56.  
  57. <dt><b>userdata</b> </dt>
  58. <dd>Pointer the user data which is passed to the
  59. callback function </dd>
  60. </dl>
  61.  
  62. <h2><a name='sect3' href='#toc3'>Description</a></h2>
  63. <p>
  64. The <b>SDL_AudioSpec</b> structure is used to describe
  65. the format of some audio data. This structure is used by <i><b>SDL_OpenAudio</b></i> and
  66. <i><b>SDL_LoadWAV</b></i>. While all fields are used by <b>SDL_OpenAudio</b> only <b>freq</b>, <b>format</b>,
  67. <b>samples</b> and <b>channels</b> are used by <b>SDL_LoadWAV</b>. We will detail these common
  68. members here. 
  69. <dl>
  70.  
  71. <dt><b>freq</b> </dt>
  72. <dd>The number of samples sent to the sound device every
  73. second. Common values are 11025, 22050 and 44100. The higher the better. </dd>
  74.  
  75. <dt><b>format</b>
  76. </dt>
  77. <dd>Specifies the size and type of each sample element  </dd>
  78.  
  79. <dt><b>AUDIO_U8</b></dt>
  80. <dd></dd>
  81.  
  82. <dt><b>AUDIO_S8</b></dt>
  83. <dd></dd>
  84.  
  85. <dt><b>AUDIO_U16</b>
  86. or <b>AUDIO_U16LSB</b></dt>
  87. <dd></dd>
  88.  
  89. <dt><b>AUDIO_S16</b> or <b>AUDIO_S16LSB</b></dt>
  90. <dd></dd>
  91.  
  92. <dt><b>AUDIO_U16MSB</b></dt>
  93. <dd></dd>
  94.  
  95. <dt><b>AUDIO_S16MSB</b></dt>
  96. <dd></dd>
  97.  
  98. <dt><b>AUDIO_U16SYS</b></dt>
  99. <dd></dd>
  100.  
  101. <dt><b>AUDIO_S16SYS</b></dt>
  102. <dd></dd>
  103.  
  104. <dt><b>channels</b>
  105. </dt>
  106. <dd>The number of seperate sound channels. 1 is mono (single channel), 2 is
  107. stereo (dual channel). </dd>
  108.  
  109. <dt><b>samples</b> </dt>
  110. <dd>When used with <i><b>SDL_OpenAudio</b></i> this refers
  111. to the size of the audio buffer in samples. A sample a chunk of audio data
  112. of the size specified in <b>format</b> mulitplied by the number of channels. When
  113. the <b>SDL_AudioSpec</b> is used with <i><b>SDL_LoadWAV</b></i> <b>samples</b> is set to 4096. </dd>
  114. </dl>
  115.  
  116. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  117. <p>
  118. <i><b>SDL_OpenAudio</b></i>,
  119. <i><b>SDL_LoadWAV</b></i> 
  120. <!--
  121.   
  122.  <p>
  123.  
  124. <hr><p>
  125. <a name='toc'><b>Table of Contents</b></a><p>
  126. <ul>
  127. <li><a name='toc0' href='#sect0'>Name</a></li>
  128. <li><a name='toc1' href='#sect1'>Structure Definition</a></li>
  129. <li><a name='toc2' href='#sect2'>Structure Data</a></li>
  130. <li><a name='toc3' href='#sect3'>Description</a></li>
  131. <li><a name='toc4' href='#sect4'>See Also</a></li>
  132. </ul>
  133. </body>
  134. </html>
  135.