<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="soundlib.xslt"?>
<helpfile title="SoundLib 3 help file">
  <head>
    <img src="sl3.png" border="0"/><br/>
    SoundLib3 (c) 1997-2008 by Stefan Goehler<br/>
    Last update of this helpfile: 23rd of January 2008<br/>
    This helpfile is for version 3 beta 2 of SoundLib only.<br/>
  </head>
  <helpindex>
  <head>INDEX</head>
    <chapter id="chapter_intro"/>
    <chapter id="chapter_tsoundinterface"/>
    <chapter id="chapter_tsoundcollection"/>
    <chapter id="chapter_tsoundstream"/>
    <chapter id="chapter_tsample"/>
    <chapter id="chapter_tsoundfile"/>
    <chapter id="chapter_types"/>
  </helpindex>

  <chapters>
    <chapter id="chapter_intro">
      <head>Introduction</head>

      <helpitem id="intro">
        <head>About SoundLib</head>
        <body>
          <text>
            SoundLib is a Multichannel and 3D sound mixing library for Delphi, Free Pascal and C++.<br/>
            It is quite comprehensive but avoids to offload this to the user. Instead, most
            functionality will initialize itself, like the selection of the best output
            interface, output device and its speaker selection. However, advanced users have the possibility to access and control extended features.<br/>
            Goals of SoundLib
            
            <ul>
            	<li>Simplicity -- Easy to use API, free formats avoid licensing hassle</li>
            	<li>Hands free -- Initializes what you likely need, but only if you want so</li>
            	<li>Straight formats -- Supports every free format you need for development, not every format on market</li>
            	<li>Platform independence -- Pure software mixer makes it sound the same anywhere, everywhere</li>
            </ul>
          </text>
        </body>
      </helpitem>

      <helpitem id="contact">
        <head>Contacting the author</head>
        <body>
          <text>E-Mail: stefan.goehler at gmx.de<br/>
          <br/>
          My homepage Crossfire Designs is accessible at this URL:<br/>
          <a href="http://www.crossfire-designs.de/" target="_blank">http://www.crossfire-designs.de/</a><br/>
          Get SoundLib here:<br/>
          <a href="http://www.soundlib.net/" target="_blank">http://www.soundlib.net/</a><br/>
          <br/>
          You will always find the latest version of SoundLib on both pages.<br/>
          </text>
        </body>
      </helpitem>

      <helpitem id="library">
        <head>Library SoundLib</head>
        <body>
          <text>
          Classes<br/>
          <ul>
            <li><topic id="class_tsoundinterface"/> -- Sound interface class</li>
            <li><topic id="class_tsoundcollection"/> -- Organizes streams and samples</li>
            <li><topic id="class_tsoundstream"/> -- Sound streaming class</li>
            <li><topic id="class_tsoundfile"/> -- Loads and streams sound files</li>
            <li><topic id="class_tsample"/> -- Static sound (from stream or memory) class</li>
          </ul>

          To get more information about the object layers in SoundLib, please
          read the chapter <topic id="understanding"/>.<br/>
          </text>
        </body>
      </helpitem>

      <helpitem id="understanding">
         <head>Understanding the SoundLib class system</head>
         <body>
           <text>
           The SoundLib class system consists of 3 layers.<br/>
           First the interface layer, represented by the <topic id="class_tsoundinterface">tSoundInterface</topic> class.
           Second the Sound layer (<topic id="class_tsoundcollection">tSoundCollection</topic> and derivates), and third the Sound
           Stream layer (Derivates of <topic id="class_tsoundstream">tSoundStream</topic>).<br/>

   <pre>           tSoundInterface                  ----- Interface layer
           /            \
          /              \
         /               tSoundCollection   ----- Sound Collection layer
 tSoundCollection       /      \
     /     \           /        \
    /  tSoundStream   /     tSoundStream    ----- Sound Stream layer
   /              tSoundStream
tSoundStream</pre>
           No layer can be initialized before the layer above has been initialized.
           Changing the volume and other details of a layer above affects all layers below.<br/>
           <br/>
           Closing layers above WON'T close the lower layers. Instead close all lower layers FIRST.<br/>
           <br/>
           Adding new sound layers will lower the overall volume. It's recommended not to use more than 2 tSoundCollection layers. 
					 One for playing the program's samples, the other for playing e.g. background music. All Sound Object layers
           should be open at program start, so the volume keeps the same all the time.
           </text>
         </body>
      </helpitem>

      <helpitem id="sample">
         <head>Definition: Samples</head>
         <body>
           <text>
           In the help file, there's always something about 'bytes, NOT samples'.
           Well...<br/>
           to make some things easier to use and to avoid channel problems and
           similar, all procedures, which have something to do with accessing the
           sound data, take their values in samples.<br/>
           <br/>
           A sample is an information unit for all channels at the same
           time of playing. So if you have an 8 bit Stereo file, the sample
           sizes 2 bytes (2 channels at each 1 byte). It's the same with 16 bit Mono data (1 channel at 2 bytes).<br/>
           To give you the method how SoundLib calculates the size of a sample:<br/>
           (Resolution in bits)/8 * (Number of channels)<br/>
           <br/>
           So if you want to get to a position within the sample, just give the method the sample position.
           You don't have to care about if the file is Multichannel or Mono or which resolution it has got.
           </text>
         </body>
      </helpitem>

      <helpitem id="formats">
        <head>Supported file formats</head>
        <body>
          <text>
            SoundLib does currently support as sample formats WAVe files (uncompressed PCM, 8..16 bits, mono up to multichannel), OGG Vorbis and FLAC files (both any format,
            also multichannel). Concerning music files, SoundLib does support <topic id="modules">MODule</topic> files with the formats MOD/WOW/NST, S3M and
            XM. SoundLib supports MOD and S3M surround commands. Additionally, all front speakers are being used for MODule playback (this currently
            means a center speaker is being used if present).<br/>
            <br/>
            If you intend to load OGG files, you have to put ogg.dll, vorbis.dll and vorbisfile.dll into the same directory as your application and soundlib.dll.
            To put it into different words: adding the vorbis DLL files is optional, SoundLib works without them (but can't load OGG then).<br/>
            The same applies to FLAC: put libflac.dll in the same directory if you need FLAC support.
          </text>
        </body>
      </helpitem>

      <helpitem id="modules">
        <head>About MODule music files</head>
        <body>
          <text>
          Modules are music files based upon samples and information about how to play them back. They are thus similar to the MIDI concept, except
          for having their own samples. This lends those files a big advantage: while they keep the size down, they sound the same on every system.<br/>
          Classic MOD files originate from the Amiga Tracker "The Ultimate Soundtracker" by Karsten Obarski. While the Amiga limited these
          files somehow to four channels, this limit has been abandoned with PC trackers. The latter also introduced new file formats, like
          S3M, XM and IT. Except for IT support, which is currently under development, all these formats are supported (MOD and S3M should be
          perfect, about 90% of XM files play without problems).<br/>
          While Modules are not free, there are thousands of them available on several sites. You may contact their respective authors
          in case you want to use them in your production. In many cases stating the authors in your work is enough, such details are mostly 
					provided in the instrument information of these files, which often acts as a built-in "readme" file.<br/>
					<br/>
          Some points to start:<br/>
          <a href="http://modarchive.org/" target="_blank">Modarchive.org</a><br/>
          <a href="http://flatdisk.back2roots.org/" target="_blank">fLAtDiSk</a><br/>
          <a href="http://amp.dascene.net/" target="_blank">Amiga Music Preservation Archive</a>
          </text>
        </body>
      </helpitem>

      <helpitem id="include_delphi">
        <head>Including SoundLib to Delphi</head>
        <body>
          <text>
          <ul>
            <li>Open the project's properties by pressing Shift+CRTL+F11</li>
            <ul>
              <li>Select tab "Directories/Conditions"</li>
              <li>Add the soundlib header path to the search paths</li>
            </ul>
            <li>Add soundlib3dll and vectors to the uses clause</li>
            <li>Copy all necessary DLL files into your project's directory</li>
          </ul>  
          </text>
        </body>
      </helpitem>

      <helpitem id="include_lazarus">
        <head>Including SoundLib to Lazarus</head>
        <body>
          <text>
          <ul>
            <li>Open the project's compiler settings (Project->Compiler Settings)</li>
            <ul>
              <li>Select tab "Paths"</li>
              <li>Add the soundlib header path to the unit paths</li>
            </ul>
            <li>Add soundlib3dll and vectors to the uses clause</li>
            <li>Copy all necessary DLL files into your project's directory</li>
          </ul>  
          </text>
        </body>
      </helpitem>

      <helpitem id="include_cpp">
        <head>Including SoundLib to Microsoft Visual C++</head>
        <body>
          <text>
          All configuration identifiers have been translated from the german version of MSVC++ 2005, hence names may differ slightly
          in english version.
          <ul>
            <li>Open the project properties by pressing Alt+F7</li>
            <ul>
              <li>Add the SoundLib headers path under Project properties->C/C++->Common</li>
              <li>Add the SoundLib library path under Project properties->Linker->Common</li>
              <li>Add "soundlib.lib" to the additional dependencies under Project properties->Linker->Input</li>
            </ul>
            <li>Add soundlib.h and soundlib.cpp to your project's project map (simply drag them)</li>
            <li>Copy all necessary DLL files into your project's directory</li>
          </ul>  
            
          </text>
        </body>
      </helpitem>

      <helpitem id="error_handling">
        <head>Error handling</head>
        <body>
          <text>
          SoundLib does error handling by throwing exceptions. This an effective and proven system under both Pascal and C++ compilers.<br/>
          All errors are strings (C++: char*) messages and usually mean that you can't work any further with the class that generated this
          message.<br/>
          <br/>
          Error handling example for Pascal compilers:
          <sourcecode>  uses ...,soundlib3dll,sysutils;
  ...
  try
    driver.startplayback(); 
  except
    on E: Exception do
      error('Could not initialize sound output ('+E.Message+')');
  end;            </sourcecode>

          Error handling example for C++ compilers:
          <sourcecode>  #include "soundlib.h"
  #include "iostream"
  ...
  try
  {
    driver->startplayback(); 
  }
  catch (char* s)
  {
    cout &lt;&lt; "Could not initialize sound output: ";
    cout &lt;&lt; s;
  }            </sourcecode>
          
          </text>
        </body>
      </helpitem>


      <helpitem id="tnt">
        <head>Tips &amp; Tricks</head>
        <body>
          <text>
          </text>
        </body>
      </helpitem>

    </chapter>

    <chapter id="chapter_tsoundinterface">
      <head>Class tSoundInterface</head>

      <helpitem id="class_tsoundinterface">
        <head>Class tSoundInterface</head>
        <body>
          <text>
            This class is the father object for any registered sound driver used in SoundLib.<br/>
            <br/>
            Methods<br/>
            <ul>
             <li><topic id="tsi_constructor"/> -- Initializes the tSoundInterface object</li>
             <li><topic id="tsi_destructor"/> -- Closes the tSoundInterface object</li>
             <li><topic id="tsi_startplayback"/> -- Starts the sound playback at certain values</li>
             <li><topic id="tsi_stopplayback"/> -- Stops the playback</li>
             <li><topic id="tsi_isplaying"/> -- Returns true if playback running</li>
             <li><topic id="tsi_getplaybackinfo"/> -- Returns information about playback details</li>
             
             <li><topic id="tsi_getdeviceinfo"/> -- Fills record with physical device information</li>
             <li><topic id="tsi_setdevice"/> -- Selects physical sound device</li>
             <li><topic id="tsi_getcurrentdevice"/> -- Returns current device ID</li>
             <li><topic id="tsi_getdevicecount"/> -- Returns number of devices</li>
             
             <li><topic id="tsi_getinterfaceinfo"/> -- Fills record with physical interface information</li>
             <li><topic id="tsi_setinterface"/> -- Selects physical sound device</li>
             <li><topic id="tsi_getcurrentinterface"/> -- Returns current interface ID</li>
             <li><topic id="tsi_getinterfacecount"/> -- Returns number of interfaces</li>
             
             <li><topic id="tsi_getmixcount"/> -- Returns current number of mixed buffers</li>
             <li><topic id="tsi_setmixmanual"/> -- Toggles manual/automatic mixing</li>
             <li><topic id="tsi_getmixdata"/> -- Returns mixed sound data (internal format)</li>
             <li><topic id="tsi_getoutputdata"/> -- Returns mixed sound data (sound device format)</li>

             <li><topic id="tsi_setlistenervelocity"/> -- Sets listener's speed</li>
             <li><topic id="tsi_setlistenerposition"/> -- Sets listener's position</li>
             <li><topic id="tsi_setlistenerorientation"/> -- Sets listener's orientation</li>
             <li><topic id="tsi_updatelistener"/> -- Updates all listener values in one function</li>
            </ul>

             CONSTANTs
            <ul>
             <li><topic id="214">cnt_xxxx</topic> -- Output control constant</li>
            </ul>

             TYPEs
            <ul>
            	<li><topic id="214">tDeviceInfo</topic> -- Hardware information structure</li>
            	<li><topic id="214">tInterfaceInfo</topic> -- Sound interface information structure</li>
            </ul>
          </text>
        </body>
      </helpitem>

      <helpitem id="tsi_constructor">
        <head>tSoundInterface constructor</head>
        <body>
          <short>Initializes the sound interface.</short>

          <definition lang="pascal">constructor create;</definition>
          <definition lang="c++">tSoundInterface();</definition>

          <seealso>
           <item><topic id="tsi_destructor"/></item>
           <item><topic id="class_tsoundinterface"/></item>
          </seealso>
         </body>
      </helpitem>

      <helpitem id="tsi_destructor">
        <head>tSoundInterface destructor</head>
        <body>
          <short>Closes the tSoundInterface object, deinitializes interface and variables.</short>

          <definition lang="pascal">destructor destroy;</definition>
          <definition lang="c++">~tSoundInterface(void);</definition>

          <seealso>
            <item><topic id="tsi_constructor"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_startplayback">
        <head>startPlayback</head>
        <body>
          <short>Starts the sound playback with the given values.</short>
          <definition lang="pascal">procedure startPlayback(frequency,flags,channels,buffersize,buffers : longword);</definition>
          <definition lang="c++">void startPlayback(unsigned int frequency,unsigned int flags,unsigned int channels,unsigned int buffersize,unsigned int buffers);</definition>
          <variables>
            <keyword>Frequency</keyword> is the playback frequency to be used. You can request the
            possible frequencies by using <topic id="tsi_getdeviceinfo"/>.
            If you us the value 0 for <keyword>Frequency</keyword>, the driver will automatically use
            the recommended available value (usually 48Khz, if below, the highest possible value).<br/>
            <br/>
            <keyword>Channels</keyword> forces a certain number of output channels to be used. Set this to 0 to let SoundLib choose the best value (uses system's audio control
						panel values).<br/>
						<br/>
            Usable values for channels:
            <table>
             <tr><th>Constant</th><th>Explanation</th></tr>
             <tr><td>channels_mono</td><td>Mono playback</td></tr>
             <tr><td>channels_stereo</td><td>Stereo playback</td></tr>
             <tr><td>channels_4</td><td>4 channel playback (L,R,RL,RR)</td></tr>
             <tr><td>channels_5</td><td>5 channel playback (L,R,C,RL,RR)</td></tr>
             <tr><td>channels_6</td><td>6 channel playback (L,R,C,RL,RR,CS)</td></tr>
             <tr><td>channels_7</td><td>7 channel playback (L,R,RL,RR,SL,SR)</td></tr>
             <tr><td>channels_lfe</td><td>Add LFE channel to output format (NOT recommended)</td></tr>
            </table>
						Please be aware that activating the LFE is currently not recommended. SoundLib automatically chooses if enabling LFE is required
						for playback.
            <br/>
            <keyword>Buffersize</keyword> is the buffer size to use in <topic id="sample">samples</topic>.
            If it is 0, the default buffer size will be used (recommended, uses 1024 <topic id="sample">samples</topic>). This value may be
						slightly adjusted by the output methods.<br/>
            <br/>
            <keyword>Buffers</keyword> determines the number of buffers used for playback. The default value here is usually 3, but depends on 
            the output interface, operating system and sound card (SoundLib may raise the value if it is known to be necessary).<br/>
						Please read the "important" section to find out more about buffers and buffer size, they effectively determine
						the playback quality and why the defaults may not work on some machines due to bad drivers.
						<br/>
            <br/>
            <keyword>Flags</keyword> are the initialization commands.<br/>
            <br/>
            Usable flags:
            <table>
             <tr><th>Constant</th><th>Explanation</th></tr>
             <tr><td>snd_default</td><td>Default; 8 bits playback</td></tr>
             <tr><td>snd_8bit</td><td>8 bit sample output</td></tr>
             <tr><td>snd_16bit</td><td>16 bit sample output</td></tr>
             <tr><td>snd_24bit</td><td>24 bit sample output</td></tr>
             <tr><td>snd_signed</td><td>Use signed samples (recommended for 16 bits+)</td></tr>
             <tr><td>snd_monosurround</td><td>Surround playback with one surround channel (Dolby Pro Logic compatible)</td></tr>
             <tr><td>snd_stereosurround</td><td>Surround playback with two surround channels (Dolby Pro Logic II compatible playback)</td></tr>
            </table>
            Many flags can be combined, so will<br/>
             <sourcecode>startPlayback(48000,snd_16bit+snd_signed,channels_stereo);</sourcecode>
            start the playback at 48000 Hz at 16 bit Stereo (signed) with automatic buffer size.<br/>
            <br/>
            Please be aware that SoundLib may alter some variables in order that the output works. So sometimes an LFE channel will be added (OpenAL multichannel playback),
            snd_monosurround and snd_stereosurround are ignored (number of channels not equal 2) and the signed flag will usually be set for any format with a resolution
            above 8 bits.
          </variables>
          <additional>
 						<b>This is the most important method of SoundLib. Please make sure you read everything thoroughly to give the best application experience to your users.</b>
            If you use the snd_auto flag, the driver will automatically choose the best available settings on your card. SoundLib, however, can not certainly
						determine if the user has a Pro Logic or Pro Logic II compatible sound set, so choosing the output type should be offered to the user.<br/>
            <br/>
            Snd_monosurround allows Dolby Pro Logic compatible playback. It requires a Pro Logic capable amplifier to hear the surround signal the right way. However,      
            snd_monosurround also produces a slight surround effect even when not played on a surround capable amplifier. Pro Logic compatible playback is recommended even for use 
            on stereo systems if you use 3D positioning of sounds. 
          </additional>

          <important>
           <item>The larger the buffer and the more buffers used, the longer the response time until an action
           is effectively heard. The buffer size determines how many times per seconds newly started sounds will 
           be recognized (default: 48000 Hz / 1024 Samples = 47 ms), this is recommended not to be larger than 2048
					 Samples, while 512 samples will probably create problems when using too few buffers.
           </item>
           <item>
					 The number of buffers determines the lag between when a sound starts and the user hears it (default mean 
					 time: 3 buffers, one to be filled with one actively playing: (3-1[fill]-1[play])*47 ms+0.5[average playback lag]*47 ms+(unknown driver lag) 
           = 70.5 ms+(unknown driver lag)).<br/>
					 Using too few buffers (&lt; 3) will create crackle on certain sound cards, sometimes bad written drivers will force
					 you to use even more buffers (probably 5 or more) to have crackle free playback. <i>It is absolutely recommended to let
					 the user choose the number of buffers. While a lag below or equal to 150 ms won't be noticed by most users, values
					 above this will lower the experience. Inform your users about that, push them to install the latest sound drivers
					 if they experience problems with playback!</i>
           </item>
           <item>Output of more than 6 channels has not been tested yet. It should work, but there may be unknown bugs.</item>
          </important>

          <throws>
           <item>Playback format not supported</item>
           <item>Number of buffers or buffer size not supported</item>          
          </throws>
          
          <seealso>
            <item><topic id="tsi_stopplayback"/></item>
            <item><topic id="tsi_isplaying"/></item>
            <item><topic id="tsi_constructor"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_stopplayback">
        <head>stopPlayback</head>
        <body>
          <short>Stops the current playback.</short>

          <definition lang="pascal">procedure stopPlayback;</definition>
          <definition lang="c++">void stopPlayback();</definition>
          <additional>Allows to call <topic id="tsi_startplayback"/> again, possibly with other settings.</additional>

          <seealso>
            <item><topic id="tsi_startplayback"/></item>
            <item><topic id="tsi_isplaying"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_isplaying">
        <head>isPlaying</head>
        <body>
          <short>Returns true if output interface plays back.</short>

          <definition lang="pascal">function isPlaying;</definition>
          <definition lang="c++">bool isPlaying();</definition>

          <seealso>
            <item><topic id="tsi_startplayback"/></item>
            <item><topic id="tsi_stopplayback"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getplaybackinfo">
        <head>getPlaybackInfo</head>
        <body>
          <short>Returns information about current playback details.</short>

          <definition lang="pascal">function getPlaybackInfo : <topic id="type_tplaybackinfo">tPlaybackInfo</topic>;</definition>
          <definition lang="c++"><topic id="type_tplaybackinfo">tPlaybackInfo</topic> getPlaybackInfo();</definition>
          <additional>
						This function is especially useful if you rely on automatic playback initialization. Returned information is only valid if <topic id="tsi_startplayback">startPlayback</topic> has successfully been called.
          </additional>

          <seealso>
            <item><topic id="tsi_startplayback"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getdeviceinfo">
        <head>getDeviceInfo</head>
        <body>
          <short>Returns information about the currently used sound device.</short>
          <definition lang="pascal">function getDeviceInfo(device : longword) : <topic id="type_tsounddeviceinfo">tSoundDeviceInfo</topic>;</definition>
          <definition lang="c++"><topic id="type_tsounddeviceinfo">tSoundDeviceInfo</topic> getDeviceInfo(unsigned int device);</definition>

          <seealso>
            <item><topic id="tsi_setdevice"/></item>
            <item><topic id="tsi_getdevicecount"/></item>
            <item><topic id="tsi_getcurrentdevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_setdevice">
        <head>setDevice</head>
        <body>
          <short>Selects physical device for sound output.</short>
          <additional>Usually, SoundLib selects the best fitting (and working) output device for the platform. In case you want to
          change the device anyway, or you plan to offer functions for user based device selection, use this method.<br/>
          You can get the list of available devices by using <topic id="tsi_getdevicecount"/> and querying information
          about these devices using <topic id="tsi_getdeviceinfo"/>.<br/>
          Switching devices is not possible while playback. You have to call <topic id="tsi_stopplayback"/> and start the playback again via
          <topic id="tsi_startplayback"/>. The speed of the switch depends on the output, but generally switching should happen with almost no
          interrupt in sound playback.</additional>
          <definition lang="pascal">procedure setDevice(device : longword);</definition>
          <definition lang="c++">void setDevice(unsigned int device);</definition>

          <seealso>
            <item><topic id="tsi_getdeviceinfo"/></item>
            <item><topic id="tsi_getdevicecount"/></item>
            <item><topic id="tsi_getcurrentdevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getdevicecount">
        <head>getDeviceCount</head>
        <body>
          <short>Count of available output devices.</short>
          <additional>The available output devices usually refer to all physical sound devices available on your system.</additional>
          <definition lang="pascal">function getDeviceCount : longword;</definition>
          <definition lang="c++">unsigned int getDeviceCount();</definition>

          <seealso>
            <item><topic id="tsi_setdevice"/></item>
            <item><topic id="tsi_getdeviceinfo"/></item>
            <item><topic id="tsi_getcurrentdevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getcurrentdevice">
        <head>getCurrentDevice</head>
        <body>
          <short>Returns id of currently used output device.</short>
          <definition lang="pascal">function getCurrentDevice : longword;</definition>
          <definition lang="c++">unsigned int getCurrentDevice();</definition>

          <seealso>
            <item><topic id="tsi_setdevice"/></item>
            <item><topic id="tsi_getdeviceinfo"/></item>
            <item><topic id="tsi_getdevicecount"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_getinterfaceinfo">
        <head>getInterfaceInfo</head>
        <body>
          <short>Returns information about the currently used sound interface.</short>
          <definition lang="pascal">function getInterfaceInfo(device : longword) : <topic id="type_tsoundinterfaceinfo">tSoundInterfaceInfo</topic>;</definition>
          <definition lang="c++"><topic id="type_tsoundinterfaceinfo">tSoundInterfaceInfo</topic> getInterfaceInfo(unsigned int device);</definition>

          <seealso>
            <item><topic id="tsi_setinterface"/></item>
            <item><topic id="tsi_getinterfacecount"/></item>
            <item><topic id="tsi_getinterfacedevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_setinterface">
        <head>setDevice</head>
        <body>
          <short>Selects interface for sound output.</short>
          <additional>Usually, SoundLib selects the best fitting (and working) interface for the platform. For the Windows platform,
          this is usually DirectSound. In case you want to change the interface anyway, or you plan to offer functions for user based
          interface selection, use this method.<br/>
          You can get the list of available interfaces by using <topic id="tsi_getinterfacecount"/> and querying information
          about these interfaces using <topic id="tsi_getinterfaceinfo"/>.<br/>
          Switching devices is not possible while playback. You have to call <topic id="tsi_stopplayback"/> and start the playback again via
          <topic id="tsi_startplayback"/>. Keep in mind that in case you do sound device selection, devices differ depending on the selected
          interface.<br/>
          The speed of the switch depends on the output, but generally switching should happen with almost no
          interrupt in sound playback.</additional>
          <definition lang="pascal">procedure setInterface(device : longword);</definition>
          <definition lang="c++">void setInterface(unsigned int device);</definition>

          <seealso>
            <item><topic id="tsi_getinterfaceinfo"/></item>
            <item><topic id="tsi_getinterfacecount"/></item>
            <item><topic id="tsi_getinterfacedevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getinterfacecount">
        <head>getInterfaceCount</head>
        <body>
          <short>Returns count of available interfaces.</short>
          <additional>The available interfaces refer to the installed sound interfaces on your system (Windows: WaveOut, DirectSound, OpenAL).</additional>
          <definition lang="pascal">function getInterfaceCount : longword;</definition>
          <definition lang="c++">unsigned int getInterfaceCount();</definition>

          <seealso>
            <item><topic id="tsi_setinterface"/></item>
            <item><topic id="tsi_getinterfaceinfo"/></item>
            <item><topic id="tsi_getinterfacedevice"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getcurrentinterface">
        <head>getCurrentInterface</head>
        <body>
          <short>Returns id of currently used interface.</short>
          <definition lang="pascal">function getCurrentInterface : longword;</definition>
          <definition lang="c++">unsigned int getCurrentInterface();</definition>

          <seealso>
            <item><topic id="tsi_setinterface"/></item>
            <item><topic id="tsi_getinterfaceinfo"/></item>
            <item><topic id="tsi_getinterfacecount"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_getmixcount">
        <head>getMixCount</head>
        <body>
          <short>Returns number of mixed buffers since startPlayback.</short>
          <definition lang="pascal">function getMixCount : cardinal;</definition>
          <definition lang="c++">unsigned int getMixCount();</definition>
          <additional>Useful, if you run any sound analyzing software and need to read to current output buffer or you do the mixing manual by using
          <topic id="tsi_setmixmanual"/>.
          </additional>

          <seealso>
            <item><topic id="class_tsoundinterface"/></item>
            <item><topic id="tsi_setmixmanual"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_setmixmanual">
        <head>setMixManual</head>
        <body>
          <short>Toggles manual mixing.</short>
          <definition lang="pascal">procedure setMixManual(active : boolean);</definition>
          <definition lang="c++">void setMixManual(bool active);</definition>
          <additional>Usually, the sound interface driver does the mixing using a thread. You can switch to manual mixing (without hearing output!) by
          using this function. Mix and get the sound data with <topic id="tsi_getmixdata"/> or <topic id="tsi_getoutputdata"/>.<br/>
          This function is only useful if you want to pass away the output sound data to your own target, for example for a disk writer.
          </additional>

          <seealso>
            <item><topic id="class_tsoundinterface"/></item>
            <item><topic id="tsi_getmixdata"/></item>
            <item><topic id="tsi_getoutputdata"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tsi_getmixdata">
        <head>getMixData</head>
        <body>
          <short>Returns mixing buffer data (internal format).</short>
          <definition lang="pascal">procedure getMixData(dest : pointer);</definition>
          <definition lang="c++">void getMixData(void *dest);</definition>
          <additional>Will return internal mixing buffer format. This is either a 32 bits integer format with a 2 bits clipping window (essentially
          30 bits, but at this point no clipping has been applied!) or a 32 bits floating point value (single). If getPlaybackInfo.is_fp is true,
          floating point values are being used.<br/>
					There are two ways to use this function. In case you use normal playback, ensure that the current buffer changed by
          observing the number of mixed buffers with <topic id="tsi_getmixcount"/>. <br/>
          In case you want to mix your data manually, use <topic id="tsi_setmixmanual"/> to enable manual mixing. You won't hear any output,
          instead, with every call of getMixData, a new block will be mixed to your buffer.<br/>
          You need to reserve memory for your destination buffer; in any case, the size has to be getPlaybackInfo.buffersize*getPlaybackInfo.inSampleSize!
					</additional>

          <seealso>
            <item><topic id="class_tsoundinterface"/></item>
            <item><topic id="tsi_setmixmanual"/></item>
            <item><topic id="tsi_getoutputdata"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_getoutputdata">
        <head>getMixData</head>
        <body>
          <short>Returns mixing buffer data (sound device format).</short>
          <definition lang="pascal">procedure getOutputData(dest : pointer);</definition>
          <definition lang="c++">void getOutputData(void *dest);</definition>
          <additional>There are two ways to use this function. In case you use normal playback, ensure that the current buffer changed by
          observing the number of mixed buffers with <topic id="tsi_getmixcount"/>. <br/>
          In case you want to mix your data manually, use <topic id="tsi_setmixmanual"/> to enable manual mixing. You won't hear any output,
          instead, with every call of getMixData, a new block will be mixed to your buffer.<br/>
          You need to reserve memory for your destination buffer; in any case, the size has to be getPlaybackInfo.buffersize*getPlaybackInfo.outSampleSize!
          The returned data is the output format that has been chosen when calling <topic id="tsi_startplayback"/>. Since some values may have been
          adapted by the output driver, ensure you use the values returned by <topic id="tsi_getplaybackinfo"/>.
					</additional>

          <seealso>
            <item><topic id="class_tsoundinterface"/></item>
            <item><topic id="tsi_setmixmanual"/></item>
            <item><topic id="tsi_getmixdata"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_setlistenerposition">
        <head>setListenerPosition</head>
        <body>
          <short>Sets listener's position in 3D environment.</short>
          <additional>Given values are based on metres.</additional>

          <definition lang="pascal">procedure setListenerPosition(position : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setListenerPosition(<topic id="type_tsvector">tSVector</topic> position);</definition>

          <seealso>
            <item><topic id="tsi_setlistenerorientation"/></item>
            <item><topic id="tsi_setlistenervelocity"/></item>
            <item><topic id="tsi_updatelistener"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_setlistenerorientation">
        <head>setListenerOrientation</head>
        <body>
          <short>Sets listener's orientation in 3D environment.</short>
          <additional>Values for this function are radian based (2*pi rad = 360 degrees).</additional>

          <definition lang="pascal">procedure setListenerOrientation(orientation : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setListenerOrientation(<topic id="type_tsvector">tSVector</topic> orientation);</definition>

          <seealso>
            <item><topic id="tsi_setlistenerposition"/></item>
            <item><topic id="tsi_setlistenervelocity"/></item>
            <item><topic id="tsi_updatelistener"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_setlistenervelocity">
        <head>setListenerVelocity</head>
        <body>
          <short>Sets listener's speed in 3D environment.</short>
          <additional>
             Values for this function are metres per second (m/s). Setting this to anything diffent than zero will create
             a Doppler effect by shifting the playback speed (function <topic id="tss_setspeed"/> is not affected).<br/>
             The Doppler effect created by SoundLib is physically not 100% correct. Since playback speed is affected, the
             according sample will also play faster or slower in addition to its changed frequency.
          </additional>

          <definition lang="pascal">procedure setListenerVelocity(velocity : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setListenerVelocity(<topic id="type_tsvector">tSVector</topic> velocity);</definition>

          <seealso>
            <item><topic id="tsi_setlistenerorientation"/></item>
            <item><topic id="tsi_setlistenerposition"/></item>
            <item><topic id="tsi_updatelistener"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsi_updatelistener">
        <head>updateListener</head>
        <body>
          <short>Sets listener's parameters in 3D environment.</short>
          <additional>
              Given values for <keyword>position</keyword> are based on metres. Values for <keyword>orientation</keyword> are radian based
              (2*pi rad = 360 degrees). Values for <keyword>speed</keyword> are metres per second (m/s). Setting <keyword>speed</keyword> to anything
              diffent than zero will create a Doppler effect by shifting the playback speed (function <topic id="tss_setspeed"/> is not affected).<br/>
          </additional>

          <definition lang="pascal">procedure updateListener(position, orientation, speed : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void updateListener(<topic id="type_tsvector">tSVector</topic> position, <topic id="type_tsvector">tSVector</topic> orientation, <topic id="type_tsvector">tSVector</topic> speed);</definition>

          <seealso>
            <item><topic id="tsi_setlistenerorientation"/></item>
            <item><topic id="tsi_setlistenerposition"/></item>
            <item><topic id="tsi_setlistenervelocity"/></item>
          </seealso>
        </body>
      </helpitem>

    </chapter>



    <chapter id="chapter_tsoundcollection">
      <head>class tSoundCollection</head>

      <helpitem id="class_tsoundcollection">
        <head>Class tSoundCollection</head>
        <body>
          <short>
          Holds all playback samples, channels and sound files you assign to it.</short>
          <additional>
            Methods<br/>
            <ul>
              <li><topic id="102"/> -- Initializes the tSoundCollection object</li>
              <li><topic id="103"/> -- Closes the tSoundCollection object</li>
              <li><topic id="104"/> -- Sets the volume of a tSoundCollection object channel</li>
              <li><topic id="112"/> -- Returns the volume of a tSoundCollection object channel</li>
              <li><topic id="105"/> -- Changes calculation chunk size</li>
              <li><topic id="106"/> -- Allows No of channel change after Create</li>
              <li><topic id="110"/> -- Returns SoundLib version string</li>
              <li><topic id="111"/> -- Toggle playback interpolation</li>
              <li><topic id="114"/> -- Toggle volume ramping</li>
              <li><topic id="113"/> -- Returns number of mixed blocks</li>
              <li><topic id="tsc_setenvironmentsize"/> -- Sets size of environment</li>
              <li><topic id="tsc_setenvironmenttype"/> -- Sets type of environment</li>
              <li><topic id="tsc_getuppernode"/> -- Returns upper node (tSoundInterface)</li>
            </ul>
          </additional>
        </body>
      </helpitem>


      <helpitem id="102">
        <head>tSoundCollection constructor</head>
        <body>
          <short>Initializes the tSoundCollection class.</short>
          <definition lang="pascal">constructor create(interface : <topic id="class_tsoundinterface">tSoundInterface</topic>;channels : longword);</definition>
          <definition lang="c++">tSoundCollection::tSoundCollection(<topic id="class_tsoundinterface">tSoundInterface</topic> *driver,int channels);</definition>
          <variables><keyword>Interface</keyword> is the destination sound interface where you want to playback your assigned samples. <keyword>Channels</keyword> is
          the maximum number of channels you want to play at the same time.
          </variables>
          <important>
            <item>The sound interface used for initialization has to be initialized first (you have to have called <topic id="tsi_startplayback"/>)</item>
            <item>Playing more than the given channels at once may result in sound overdrive and hence degrade sound quality!</item>
          </important>
          <throws>
            <item>sound interface wasn't initialized</item>
          </throws>
          <seealso>
            <item><topic id="103"/></item>
            <item><topic id="class_tsoundcollection"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="103">
        <head>tSoundCollection destructor</head>
        <body>
          <short>Closes the tSoundCollection object.</short>
          <definition lang="pascal">destructor destroy;</definition>
          <definition lang="c++">tSoundCollection::~tSoundCollection();</definition>
          <important>
            <item>Close ANY assigned sound before closing this object</item>
          </important>
          <throws>
            <item>any assigned objects were left</item>
          </throws>
          <seealso>
            <item><topic id="102"/></item>
            <item><topic id="class_tsoundcollection"/></item>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsc_getuppernode" type="advanced">
        <head>getUpperNode</head>
        <body>
          <short>Returns upper node (tSoundInterface).</short>

          <definition lang="pascal">function getUpperNode : <topic id="class_tsoundinterface">tSoundInterface</topic>;</definition>
          <definition lang="c++"><topic id="class_tsoundinterface">tSoundInterface</topic>* getUpperNode;</definition>

          <seealso>
            <item><topic id="class_tsoundinterface"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="104">
        <head>setVolume</head>
        <body>
          <short>Sets the volume of a channel in the object.</short>

          <definition lang="pascal">procedure setVolume(channel : integer; volume : double);</definition>
          <definition lang="c++">void setVolume(int channel, double volume);</definition>

          <variables><keyword>Channel</keyword> represents the output channel. The value chn_left is for left, chn_right
          for right and so on. Set to chn_all to affect all channels. <keyword>Volume</keyword> is a value between 0 and 2.
          If the value exceeds 1, the maximum sample volume has been reached and the amplitude will be amplified above the
          normal limit.
          This <i>MAY</i> result in volume overdrive, similar to a cassette which has been recorded too loud. The
          more channels you have and the more quiet the sound is, the less is the probability to overdrive.
          </variables>
          <additional>
          Setting the volume will affect all assigned sounds. It will NOT directly change the volume setting of any
          assigned sound. It works independend from it.
          </additional>
          <important>
            <item>Close ANY assigned sound before closing this object</item>
          </important>
          <throws>
            <item>any assigned objects were left</item>
          </throws>
          <seealso>
            <item><topic id="112"/></item>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="112">
        <head>getVolume</head>
        <body>
          <short>Returns the volume of an output channel of the object.</short>
          <definition lang="pascal">function getVolume(channel : longword) : double;</definition>
          <definition lang="c++">double getVolume(unsigned int channel);</definition>
          <variables><keyword>Channel</keyword> represents the output channel. The value chn_left is for left, value chn_right and
          so on.</variables>
          <additional>The return is a value between 0 and 2. If the value exceeds 1, the maximum sample volume has been
          reached and the amplitude is being amplified.</additional>
          <seealso>
            <item><topic id="104"/></item>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="105">
        <head>setBufferSize</head>
        <body>
          <short>Changes the calculation queue size from the default value.</short>
          <definition lang="pascal">procedure setBufferSize(samples : longword);</definition>
          <definition lang="c++">not implemented</definition>
          <additional>Default value: 1024 <topic id="sample">samples</topic>. Useful if one needs to do modifications in a certain
          time frame, e.g. in MODule-Players.</additional>
          <important>
            <item>The value "Samples" means how many <topic id="sample">samples</topic>, not bytes or words.</item>
          </important>

          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="106">
        <head>setChannels</head>
        <body>
        <short>
        Allows to change the number of channels to be played at the same time
        after you already setted it in Create.</short>
        <definition lang="pascal">procedure setChannels(channels : longword);</definition>
        <definition lang="c++">not implemented</definition>
        <seealso>
          <item><topic id="class_tsoundcollection"/></item>
          <item><topic id="102"/></item>
        </seealso>
        </body>
      </helpitem>

      <helpitem id="110">
        <head>getVersionString</head>
        <body>
          <short>Returns SoundLib version string.</short>
          <definition lang="pascal">function getVersionString : pchar;</definition>
          <definition lang="c++">not implemented</definition>

          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="111">
        <head>setInterpolation</head>
        <body>
          <short>Toggles the playback interpolation of all assigned sounds.</short>
          <definition lang="pascal">procedure setInterpolation(interpolationtype : longword);</definition>
          <definition lang="c++">void setInterpolation(unsigned int interpolationtype);</definition>
          <additional>
          This feature is turned to <keyword>INTERPOLATION_LINEAR</keyword> by default.<br/>
          Interpolation requires a slighly higher CPU time consumption, but sounds a lot better in most cases. It reduces aliasing, which is especially
          audible when playing a sample at a lower frequency than the output frequency. 
          </additional>

          <seealso>
            <item><topic id="114"/></item>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="114">
        <head>setRamping</head>
        <body>
          <short>Toggles volume ramping of all assigned sounds.</short>
          <definition lang="pascal">procedure setRamping(active : boolean);</definition>
          <definition lang="c++">void setRamping(bool active);</definition>
          <additional>
          Volume Ramping tries to avoid click sounds appearing when starting
          a sample or changing its volume.<br/>
          This feature is turned ON by default.</additional>
          <seealso>
            <item><topic id="111"/></item>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="113">
        <head>getMixCount</head>
        <body>
          <short>Returns continuous count of blocks requested by the software mixer.</short>
          <text>This function will help to detect if a new block has been mixed or - if in manual mixing mode - a new block should be mixed.
          Just compare if the returned number is higher than the last number.</text>
          <definition lang="pascal">function getMixCount : cardinal;</definition>
          <definition lang="c++">long long getMixCount();</definition>
          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsc_stopall">
        <head>stopAll</head>
        <body>
          <short>Stops all underlying streams and samples.</short>
          <definition lang="pascal">procedure stopAll;</definition>
          <definition lang="c++">void stopAll();</definition>
          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
            <item><topic id="tsc_pauseall"/></item>
            <item><topic id="tsc_resumeall"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsc_pauseall">
        <head>pauseAll</head>
        <body>
          <short>Pauses all underlying streams and samples.</short>
          <definition lang="pascal">procedure pauseAll;</definition>
          <definition lang="c++">void pauseAll();</definition>
          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
            <item><topic id="tsc_resumeall"/></item>
            <item><topic id="tsc_stopall"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsc_resumeall">
        <head>resumeAll</head>
        <body>
          <short>Resumes all underlying streams and samples.</short>
          <text>Resuming applies to all paused streams and samples under the current sound object.</text>
          <definition lang="pascal">procedure resumeAll;</definition>
          <definition lang="c++">void resumeAll();</definition>
          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
            <item><topic id="tsc_pauseall"/></item>
            <item><topic id="tsc_stopall"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsc_setenvironmenttype">
        <head>setEnvironmentType</head>
        <body>
          <short>Sets environment type.</short>
          <additional>
            This function is currently NOT supported. It will set the type of environment. According to this, reflections, echoes and hall
            effects can be calculated.
          </additional>

          <definition lang="pascal">procedure setEnvironmentType(entype : longword);</definition>
          <definition lang="c++">void setEnvironmentType(unsigned int envtype);</definition>

          <seealso>
            <item><topic id="tsc_setenvironmentsize"/></item>
          </seealso>

        </body>
      </helpitem>

      <helpitem id="tsc_setenvironmentsize">
        <head>setEnvironmentSize</head>
        <body>
          <short>Sets environment size.</short>
          <additional>
            This function is currently NOT supported. It will set the size of the environment. All values are in metres.
            According to this, reflections, echoes and hall effects can be calculated.
          </additional>

          <definition lang="pascal">procedure setEnvironmentSize(size : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setEnvironmentSize(<topic id="type_tsvector">tSVector</topic> size);</definition>

          <seealso>
            <item><topic id="tsc_setenvironmentsize"/></item>
          </seealso>
        </body>
      </helpitem>



    </chapter>


    <chapter id="chapter_tsoundstream">
      <head>Class tSoundStream</head>

      <helpitem id="class_tsoundstream">
       <head>Class tSoundStream</head>
         <body>
           <short>
             This class is the father object for any sound streaming class used in SoundLib.
           </short>
           <text>
             Only the creation and desctruction are different. So these are explained separately, additional procedures also.
           </text>
           <additional>
           Methods<br/>
           <ul>
             <li><topic id="class_tsoundstream"/> -- Sound streaming class</li>
             <li><topic id="tss_connect"/> -- Connect to sound collection</li>
             <li><topic id="tss_disconnect"/> -- Disconnect from sound collection</li>
             <li><topic id="tss_getuppernode"/> -- Returns upper node (tSoundCollection)</li>
             <li><topic id="tss_getvolume"/> -- Returns volume of a channel</li>
             <li><topic id="tss_setchannelmapping"/> -- Sets channel (input to output) mapping</li>
             <li><topic id="tss_getchannelmapping"/> -- Returns channel (input to output) mapping</li>
             <li><topic id="tss_setbuffersize"/> -- Set buffer size for playback</li>
             <li><topic id="tss_setpanning"/> -- Set panning and volume in a 3D-field</li>
             <li><topic id="tss_setinfo"/> -- Set information about the stream data</li>
             <li><topic id="tss_getinfo"/> -- Get information about the stream data</li>
             <li><topic id="tss_play"/> -- Starts playback of the object</li>
             <li><topic id="tss_pause"/> -- Pauses playback of the object</li>
             <li><topic id="tss_stop"/> -- Stops playback of the object</li>
             <li><topic id="tss_isplaying"/> -- Returns true if sound is playing</li>
             <li><topic id="tss_ispaused"/> -- Returns true if sound is paused</li>
             <li><topic id="tss_getvu"/> -- Returns VU meter value</li>
             <li><topic id="tss_setspeed"/> -- Set playback speed</li>
             <li><topic id="tss_setfrequency"/> -- Alternative to SetSpeed</li>
             <li><topic id="tss_setinterpolation"/> -- Toggle playback interpolation</li>
             <li><topic id="tss_setramping"/> -- Toggle volume ramping</li>
             <li><topic id="tss_mute"/> -- Mutes object without affecting volume or playback</li>
             <li><topic id="tss_setpos"/> -- Set position in sample data</li>
             <li><topic id="tss_getpos"/> -- Get current position in sample data</li>
             <li><topic id="tss_getsize"/> -- Get size of stream in samples</li>
             <li><topic id="tss_setobjectposition"/> -- Sets object position</li>
             <li><topic id="tss_setobjectorientation"/> -- Sets physical orientation of sound object</li>
             <li><topic id="tss_setobjectvelocity"/> -- Sets physical velocity of sound object</li>
             <li><topic id="tss_setobjectspreadangle"/> -- Sets spread angle of sound object</li>
             <li><topic id="tss_setobjectsize"/> -- Sets physical size of sound object</li>
           </ul>
           INHERITED and additional methods<br/>
           <ul>
             <li><topic id="class_tsample"/> -- Sample playback class</li>
             <li><topic id="tsample_constructor"/> -- Create object, load sample data</li>
             <li><topic id="tsample_destructor"/> -- Close object, unload sample data</li>
             <li><topic id="tsample_setloop"/> -- Set loop within sample data</li>
           </ul>
           Types<br/>
           <ul>
             <li><topic id="type_tsoundinterfaceinfo"/> -- Sound device information record</li>
           </ul>
           All other procedures are out of interest for you and only for internal
           usage.
           </additional>
         </body>
      </helpitem>

      <helpitem id="tss_connect" type="advanced">
        <head>connect</head>
        <body>
          <short>Connects stream to sound collection.</short>

          <definition lang="pascal">procedure connect(collection : <topic id="tsoundcollection">tSoundCollection</topic>);</definition>
          <definition lang="c++">void connect(<topic id="tsoundcollection">tSoundCollection</topic> collection);</definition>
          <additional>
          This procedure is being used for user streams. After calling this method, certain other methods can be called, like <topic id="tss_setchannelmapping">setChannelMapping</topic> and <topic id="tss_setspeed">setSpeed</topic>.           
          </additional>

          <important>
            <item>Use after you have set sound details using <topic id="tss_setinfo"/> and buffer size using <topic id="tss_setbuffersize"/></item>
            <item>Do not try to connect an already connected stream</item>
            <item>Do not try to start playback on not fully initialized user streams</item>
          </important>

          <throws>
            <item>Stream already connected</item>
            <item>Collection not properly initialized</item>
          </throws>

          <seealso>
            <item><topic id="tss_disconnect"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_disconnect" type="advanced">
        <head>disconnect</head>
        <body>
          <short>Disconnects stream from sound collection.</short>

          <definition lang="pascal">procedure disconnect;</definition>
          <definition lang="c++">void disconnect();</definition>

          <seealso>
            <item><topic id="tss_connect"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getuppernode" type="advanced">
        <head>getUpperNode</head>
        <body>
          <short>Returns upper node (tSoundCollection).</short>

          <definition lang="pascal">function getUpperNode : <topic id="class_tsoundcollection">tSoundCollection</topic>;</definition>
          <definition lang="c++"><topic id="class_tsoundcollection">tSoundCollection</topic>* getUpperNode;</definition>

          <seealso>
            <item><topic id="class_tsoundcollection"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setbuffersize" type="advanced">
        <head>setBufferSize</head>
        <body>
          <short>Sets buffer size of stream.</short>

          <definition lang="pascal">procedure setBufferSize(samples : longword);</definition>
          <definition lang="c++">void setBufferSize(unsigned int samples);</definition>

          <additional>
            This function is mainly for user streams and will set the buffer size of such a stream. This the exact size in
            samples which will also be used when SoundLib calls user stream class overwritten functions <topic id="tss_requestblock_direct16"/> or <topic id="tss_requestblock_directsingle"/>.<br/>
            The current buffer size can be obtained by using <topic id="type_getinfo"/>.
          </additional>

          <important>
            <item>Use this for user streams only</item>
            <item>Changing buffer size of already initialized streams may result in unexpected behaviour</item>
          </important>

          <seealso>
            <item><topic id="type_getinfo"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tss_setvolume" type="basic">
        <head>setVolume</head>
        <body>
          <short>Sets the volume of a channel.</short>

          <definition lang="pascal">procedure setVolume(channel : integer; volume : double);</definition>
          <definition lang="c++">void setVolume(int channel, double volume);</definition>
          <variables>
          <keyword>Channel</keyword> represents the output channel. The value chn_left is for left, value chn_right
          for right, higher values are for other channels. Use chn_all to affect all channels at once.<br/>
          <br/>
          <keyword>Volume</keyword> is a value between 0 and 2. If the value exceeds 1, the
          maximum sample volume has been reached and the amplitude will be amplified.
          If too many channels are very loud, this <i>MAY</i> result in distortion, similar to a
          cassette recorded too loud.
          </variables>
          <additional>
          Setting the volume here will only affect the specific sound object.</additional>

          <important>
            <item>Alternatively, you can set each sound's channel position via <topic id="tss_setpanning"/>
            in a 2D-field.</item>

            <item>Don't use SetVolume if you use <topic id="tss_setpanning"/>, they will interfere.</item>
          </important>

          <seealso>
            <item><topic id="tss_setpanning"/></item>
            <item><topic id="tss_getvolume"/></item>
            <item><topic id="tss_mute"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getvolume" type="basic">
        <head>GetVolume</head>
        <body>
          <short>Returns the volume of a channel in the object.</short>

          <definition lang="pascal">function getVolume(channel : longword) : double;</definition>
          <definition lang="c++">double getVolume(unsigned int channel : longword);</definition>
          <variables>
          <keyword>Channel</keyword> represents the output channel. The value 0 is for left, value 1
          for right, higher values are for other channels.<br/>
          <br/>
          The return is a value between 0 and 2. If the value exceeds 1, the
          maximum sample volume has been reached and the amplitude is being
          amplified.
          </variables>
          <seealso>
            <item><topic id="tss_setvolume"/></item>
            <item><topic id="tss_setpanning"/></item>
            <item><topic id="tss_mute"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setchannelmapping" type="advanced">
        <head>getChannelMapping</head>
        <body>
          <short>Set channel (input to output) mapping</short>

          <definition lang="pascal">procedure setChannelMapping(var map : <topic id="type_tchannelvolumemap">tChannelVolumeMap</topic>);</definition>
          <definition lang="c++">void setChannelMapping(<topic id="type_tchannelvolumemap">tChannelVolumeMap</topic> map);</definition>
          <variables>
          <keyword>Map</keyword> is a matrix of the type <topic id="type_tchannelvolumemap">tChannelVolumeMap</topic>.
          </variables>
          <additional>
            This method allows to map any input channel to any output channel.
          </additional>

          <important>
            <item>Don't use setChannelMapping if you use 3D positioning, they will interfere.</item>
            <item>Don't use setChannelMapping if you use <topic id="tss_setpanning"/>, they will interfere.</item>
          </important>

          <seealso>
            <item><topic id="tss_getchannelmapping"/></item>
            <item><topic id="tss_setpanning"/></item>
            <item><topic id="tss_setvolume"/></item>
            <item><topic id="tss_mute"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tss_getchannelmapping" type="advanced">
        <head>setChannelMapping</head>
        <body>
          <short>Set channel (input to output) mapping</short>

          <definition lang="pascal">function getChannelMapping : <topic id="type_tchannelvolumemap">tChannelVolumeMap</topic>;</definition>
          <definition lang="c++"><topic id="type_tchannelvolumemap">tChannelVolumeMap</topic> getChannelMapping();</definition>
          <additional>
            This method returns the current channel mapping used for this stream. Hint: calling setChannelVolumeMap(getChannelVolumeMap)
            will reset the volume functions to mapping and return from panning or 3D positioning volume setting.            
          </additional>

          <seealso>
            <item><topic id="tss_setchannelmapping"/></item>
            <item><topic id="tss_setpanning"/></item>
            <item><topic id="tss_setvolume"/></item>
            <item><topic id="tss_mute"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tss_play" type="basic">
        <head>Play</head>
        <body>

          <short>Starts the playback of the stream.</short>
          <additional>If the stream was paused, it resumes the playback from the last position, otherwise it starts at the
          beginning. You can also <topic id="tss_stop">stop</topic> or <topic id="tss_pause">pause</topic> the playback of the object.</additional>

          <definition lang="pascal">procedure play;</definition>
          <definition lang="c++">void play();</definition>

          <seealso>
            <item><topic id="tss_pause"/></item>
            <item><topic id="tss_stop"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_pause" type="basic">
        <head>Pause</head>
        <body>
          <short>Pauses the playback of the stream.</short>

          <additional>If the playback has already been paused, it resumes the playback. Alternatively to resume, you can
          also call <topic id="tss_play"/>.</additional>

          <definition lang="pascal">procedure pause;</definition>
          <definition lang="c++">void pause();</definition>

          <seealso>
            <item><topic id="tss_play"/></item>
            <item><topic id="tss_stop"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_stop" type="basic">
        <head>Stop</head>
        <body>
          <short>Stops the playback of the stream.</short>
          <additional>A call of <topic id="tss_play"/> thereafter starts the playback at the beginning of the object.</additional>

          <definition lang="pascal">procedure stop;</definition>
          <definition lang="c++">void play();</definition>

          <seealso>
            <item><topic id="tss_play"/></item>
            <item><topic id="tss_pause"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_isplaying" type="basic">
        <head>IsPlaying</head>
        <body>
          <short>Informs if stream is currently playing</short>
          <additional>Returns true if the sound is currently playing. Returns false if module
          is being paused or stopped or has been stopped.</additional>

          <definition lang="pascal">function isPlaying : Boolean;</definition>
          <definition lang="c++">bool isPlaying();</definition>

          <seealso>
            <item><topic id="tss_ispaused"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_ispaused" type="basic">
        <head>IsPaused</head>
        <body>
          <short>Returns if sound playback has been paused.</short>

          <definition lang="pascal">function isPaused : boolean;</definition>
          <definition lang="c++">bool isPaused();</definition>

          <seealso>
            <item><topic id="tss_isplaying"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getvu" type="basic">
        <head>GetVU</head>
        <body>
          <short>Returns a value which determines the current sample volume level.</short>

          <additional>Returns a value between 0..1 for VU meter displays. This has currently
          nothing to do with peak values or dB metrics, but is a simple average of the
          volume since the last call of this function.</additional>

          <definition lang="pascal">function getVU : double;</definition>
          <definition lang="c++">double getVU();</definition>

        </body>
      </helpitem>

      <helpitem id="tss_setpanning" type="advanced">
        <head>SetPanning</head>
        <body>
          <short>Sets the panning and volume of an object in a 3D-field.</short>
          <additional>
          This function is NOT a good representation of a 3D world since it doesn't set the volume by distance to the listener but by distance to the
          speaker. For this purpose, use <topic id="tss_setobjectposition"/> and similar functions instead.
          <sourcecode>
           X-AXIS (LR)

  Y
  |
  A    L       0        R
  X   -1                1
  I
  S


       LS      S       RS
              -1

  L: Left speaker
  R: Right speaker
  LS: Left surround speaker
  RS: Right surround speaker
  S: Surround speaker (when in Pro Logic compatible mode)

  0: Center speaker position
          </sourcecode>
          </additional>
          <definition lang="pascal">procedure setPanning(channel : integer; LR,CS,TB,Volume : double);</definition>
          <definition lang="c++">void setPanning(int channel, double lr, double cs, double tb, double volume);</definition>

          <variables>
          <keyword>LR</keyword> defines the position between Left and Right, <keyword>CS</keyword> the position
          between Center and Surround, <keyword>TB</keyword> the position between top and bottom (will not do anything in this version).<br/>
          <br/>
          <keyword>Volume</keyword> is a value between 0 and 2. If the value exceeds 1, the
          maximum sample volume has been reached and the amplitude will be amplified.
          This <i>MAY</i> result in volume overflow, similar to a cassette which has been
          recorded too loud.
          </variables>
          <additional>
            It's preferable to use this procedure only when in any surround mode (use mono or stereo surround even with
            a two-speaker setup, if possible). If you aren't, it's better to set the CS position to zero.
            TB values are currently ignored but will be supported in the future.
            Mono and Stereo surround modes (compatible with Dolby Pro Logic (II)) also produces a slight surround effect 
            even when not played on a surround capable amplifier.<br/>
            Surround modes can be enabled when using <topic id="tsi_startplayback"/>.
          </additional>
          <important>
            <item>Don't use <topic id="tss_setvolume"/> if you use setPanning. They will interfere!</item>
            <item>You can't use 3D positioning by using setObject* if you use panning. Once using setPanning, you switch to speaker based volume (3D positioning switches to distance based.</item>
          </important>
          <seealso>
            <item><topic id="tss_setvolume"/></item>
            <item><topic id="tsi_constructor"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getinfo" type="basic">
        <head>getInfo</head>
        <body>
          <short>Returns information about the sound stream.</short>

          <definition lang="pascal">function getInfo : <topic id="type_tsoundinfo">tSoundInfo</topic>;</definition>
          <definition lang="c++"><topic id="type_tsoundinfo">tSoundInfo</topic> getInfo();</definition>

          <additional>
          Returns information of the type <topic id="type_tsoundinfo">tSoundInfo</topic>.
          </additional>

          <seealso>
            <item><topic id="type_setinfo"/></item>
            <item><topic id="type_tsoundinfo"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setinfo" type="advanced">
        <head>setInfo</head>
        <body>
          <short>Sets user stream information.</short>

          <definition lang="pascal">procedure setInfo(info : <topic id="type_tsoundinfo">tSoundInfo</topic>);</definition>
          <definition lang="c++">void setInfo(<topic id="type_tsoundinfo">tSoundInfo</topic> info);</definition>

          <additional>
          Sets details of the user stream by using the type <topic id="type_tsoundinfo">tSoundInfo</topic>. All fields except buffersize 
          have to be filled. Use nil/null to mark non-existing text information.
          </additional>

          <important>
            <item>Use this for user streams only</item>
            <item>Changing information of already initialized streams may result in unexpected behaviour</item>
          </important>

          <seealso>
            <item><topic id="type_getinfo"/></item>
            <item><topic id="type_tsoundinfo"/></item>
          </seealso>
        </body>
      </helpitem>


      <helpitem id="tss_setspeed" type="basic">
        <head>SetSpeed</head>
        <body>
          <short>Sets the playback speed (pitch and tempo) of the stream.</short>

          <definition lang="pascal">procedure setSpeed(speed : double);</definition>
          <definition lang="c++">void setSpeed(double speed);</definition>

          <additional>
            Setting this value to e.g. 1.2 plays the stream 1.2 times faster.<br/>
            Used formula: newFrequency := normalFrequency*speed
          </additional>
          <important>
            <item>Use SetSpeed OR <topic id="tss_setfrequency"/>, not both. They both rely
            on the same data fields and will interfere.</item>
          </important>

          <seealso>
            <item><topic id="tss_setfrequency"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setfrequency" type="basic">
        <head>setFrequency</head>
        <body>
          <short>Sets the playback frequency of the stream.</short>

          <additional>This affects the playback speed (pitch).</additional>

          <definition lang="pascal">procedure setFrequency(frequency : longword);</definition>
          <definition lang="c++">void setFrequency(unsigned int frequency);</definition>

          <important>
            <item>Use <topic id="tss_setspeed"/> OR SetFrequency, not both. They both rely on the same data fields.</item>
          </important>
          <seealso>
            <item><topic id="tss_setspeed"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setinterpolation" type="basic">
        <head>SetInterpolation</head>
        <body>
          <short>Toggles playback interpolation.</short>

          <additional>
          This feature is turned to <keyword>INTERPOLATION_LINEAR</keyword> by default.<br/>
          Interpolation requires a slighly higher CPU time consumption, but sounds a lot better in most cases. It reduces aliasing, which is especially
          audible when playing a sample at a lower frequency than the output frequency. 
          </additional>

          <definition lang="pascal">procedure setInterpolation(intpoltype : longword);</definition>
          <definition lang="c++">void setInterpolation(unsigned int intpoltype);</definition>
          <seealso>
            <item><topic id="tss_setramping"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setramping" type="basic">
        <head>setRamping</head>
        <body>
          <short>Toggles volume ramping.</short>

          <additional>Volume Ramping tries to avoid click sounds appearing when starting
          a sample or changing its volume.<br/>
          <br/>
          This feature is turned ON by default.
          </additional>
          <definition lang="pascal">procedure setRamping(Active : Boolean);</definition>
          <definition lang="c++">void setRamping(bool active);</definition>

          <seealso>
            <item><topic id="tss_setinterpolation"/></item>
            <item><topic id="tss_pause"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_mute" type="basic">
        <head>Mute</head>
        <body>
          <short>Toggles muting.</short>
          <additional>The sample playback won't stop nor the sample volume values will be
          affected. You just don't hear the playback anymore.</additional>

          <definition lang="pascal">procedure mute(active : boolean);</definition>
          <definition lang="c++">void mute(bool active);</definition>
        </body>
      </helpitem>

      <helpitem id="tss_setpos" type="basic">
        <head>setPos</head>
        <body>
          <short>Sets the playback position within the sample.</short>

          <definition lang="pascal">procedure setPos(pos : cardinal);</definition>
          <definition lang="c++">procedure setPos(long long pos : longword);</definition>

          <additional>Setting positions out of the sample size range will be ignored.</additional>

          <important>
            <item>The values are NOT byte values, but <topic id="sample">sample</topic> values!</item>
          </important>

          <seealso>
            <item><topic id="tss_getpos"/></item>
            <item><topic id="tss_getsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getpos" type="basic">
        <head>getPos</head>
        <body>
          <short>Returns the current playback position.</short>
          <definition lang="pascal">function getPos : cardinal;</definition>
          <definition lang="c++">long long getPos();</definition>

          <important>
            <item>The returned values are NOT byte values, but <topic id="sample">sample</topic> values!</item>
          </important>

          <seealso>
            <item><topic id="tss_setpos"/></item>
            <item><topic id="tss_getsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_getsize" type="basic">
        <head>getSize</head>
        <body>
          <short>Returns size of the stream.</short>
          <definition lang="pascal">function getSize : cardinal;</definition>
          <definition lang="c++">long long getSize();</definition>

          <important>
            <item>The returned values are NOT byte values, but <topic id="sample">sample</topic> values! </item>
            <item>If the function returns -1, the size can't be determined (e.g. broadcasted streams)</item>
          </important>

          <seealso>
            <item><topic id="tss_getpos"/></item>
            <item><topic id="tss_setpos"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setobjectposition" type="advanced">
        <head>setObjectPosition</head>
        <body>
          <short>Sets object position in 3D environment.</short>
          <additional>Given values for <keyword>position</keyword> are based on metres. <keyword>Channel</keyword> determines which channel
          is affected. Setting <keyword>channel</keyword> to -1 will set all channels. Setting <keyword>relative</keyword> to true means
          that the sound playback will not be affected by the listener's position or orientation.<br/>
          </additional>

          <definition lang="pascal">procedure setObjectPosition(channel : integer; position : <topic id="type_tsvector">tSVector</topic>; relative : boolean);</definition>
          <definition lang="c++">void setObjectPosition(int channel, <topic id="type_tsvector">tSVector</topic> position, bool relative);</definition>

          <seealso>
            <item><topic id="tss_setobjectorientation"/></item>
            <item><topic id="tss_setobjectvelocity"/></item>
            <item><topic id="tss_setobjectspreadangle"/></item>
            <item><topic id="tss_setobjectsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setobjectorientation" type="advanced">
        <head>setObjectOrientation</head>
        <body>
          <short>Sets object orientation in 3D environment.</short>
          <additional>Given values for <keyword>orientation</keyword> are based on radians.<br/>
          IMPORTANT: This function is not functional at this moment. All sound sources are handled as POINT SOURCES ONLY.
          </additional>

          <definition lang="pascal">procedure setObjectOrientation(channel : integer; orientation : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setObjectOrientation(<topic id="type_tsvector">tSVector</topic> orientation);</definition>

          <seealso>
            <item><topic id="tss_setobjectposition"/></item>
            <item><topic id="tss_setobjectvelocity"/></item>
            <item><topic id="tss_setobjectspreadangle"/></item>
            <item><topic id="tss_setobjectsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setobjectvelocity" type="advanced">
        <head>setObjectVelocity</head>
        <body>
          <short>Sets object velocity in 3D environment.</short>
          <additional>Given values for <keyword>velocity</keyword> are based on metres per second (m/s). Setting this to anything
             diffent than zero will create a Doppler effect by shifting the playback speed (function <topic id="tss_setspeed"/> is not affected).<br/>
             Please use chn_all for <keyword>channel</keyword>, since this function can't distinguish between different channels at this
             moment of time.<br/>
             The Doppler effect created by SoundLib is physically not 100% correct. Since playback speed is affected, the
             according sample will also play faster or slower in addition to its changed frequency.
          </additional>

          <definition lang="pascal">procedure setObjectVelocity(channel : integer; velocity : <topic id="type_tsvector">tSVector</topic>); </definition>
          <definition lang="c++">void setObjectVelocity(<topic id="type_tsvector">tSVector</topic> velocity);</definition>

          <seealso>
            <item><topic id="tss_setobjectposition"/></item>
            <item><topic id="tss_setobjectorientation"/></item>
            <item><topic id="tss_setobjectspreadangle"/></item>
            <item><topic id="tss_setobjectsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setobjectspreadangle" type="advanced">
        <head>setObjectSpreadAngle</head>
        <body>
          <short>Sets object orientation in 3D environment.</short>
          <additional>Given values for <keyword>angle</keyword> are based on radians.<br/>
          IMPORTANT: This function is not functional at this moment. All sound sources are handled as POINT SOURCES ONLY.
          </additional>

          <definition lang="pascal">procedure setObjectSpreadAngle(channel : integer; angle : double);</definition>
          <definition lang="c++">void setObjectSpreadangle(double angle);</definition>

          <seealso>
            <item><topic id="tss_setobjectposition"/></item>
            <item><topic id="tss_setobjectvelocity"/></item>
            <item><topic id="tss_setobjectorientation"/></item>
            <item><topic id="tss_setobjectsize"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tss_setobjectsize" type="advanced">
        <head>setObjectSize</head>
        <body>
          <short>Sets object size in 3D environment.</short>
          <additional>Use this function to define volumetric sound sources. Given values for <keyword>size</keyword> are based on
          metres. The position of the object will be interpreted as center of its size. <br/>
          IMPORTANT: This function is not functional at this moment. All sound sources are handled as POINT SOURCES ONLY.
          </additional>

          <definition lang="pascal">procedure setObjectSize(channel : integer; size : <topic id="type_tsvector">tSVector</topic>);</definition>
          <definition lang="c++">void setObjectSize(<topic id="type_tsvector">tSVector</topic> size);</definition>

          <seealso>
            <item><topic id="tss_setobjectposition"/></item>
            <item><topic id="tss_setobjectvelocity"/></item>
            <item><topic id="tss_setobjectorientation"/></item>
            <item><topic id="tss_setobjectspreadangle"/></item>
          </seealso>
        </body>
      </helpitem>

    </chapter>


    <chapter id="chapter_tsoundfile">
      <head>class tSoundFile</head>

      <helpitem id="class_tsoundfile">
        <head>Class tSoundFile</head>
        <body>
          <short>tSoundFile extends <topic id="class_tsoundstream">tSoundStream</topic> and allows to load various sound files as a stream.</short>
          <additional>

          Methods in this class:<br/>
          <ul>
            <li><topic id="tsf_constructor"/> -- Create object</li>
            <li><topic id="tsf_destructor"/> -- Destroy object</li>
          </ul>
          </additional>
        </body>
      </helpitem>
      <helpitem id="tsf_constructor">
        <head>tSoundFile constructor</head>
        <body>

          <short>Creates a stream from a sound file.</short>

          <definition lang="pascal">constructor create(dest : <topic id="class_tsoundcollection">tSoundCollection</topic>; name : pChar);</definition>
          <definition lang="pascal">constructor create(dest : <topic id="class_tsoundcollection">tSoundCollection</topic>; s : tStream);</definition>
          <definition lang="c++">tSoundFile(<topic id="class_tsoundcollection">tSoundCollection</topic> *sound, char *name);</definition>

          <additional>
          <keyword>Dest</keyword> has to be initialized before loading, even if you intend to load the stream to a tSample or play it later.<br/>
          <br/>
          Loading by file name:<br/>
          <keyword>Name</keyword> holds the file name of the source.
					<br/>
					<br/>
          Loading by stream:<br/>
          <keyword>S</keyword> holds a stream source of the type tStream. This allows loading from sources different from files on the disk only (e.g. file
					libraries or internet).<br/>
					</additional>

          <important>
            <item>You can make a sound stream static by using <topic id="class_tsample">tSample</topic></item>
            <item>C++ implementation doesn't support file loading from streams at this moment.</item>
          </important>
          <seealso>
            <item><topic id="tsf_destructor"/></item>
          </seealso>
        </body>

      </helpitem>

      <helpitem id="tsf_destructor">
        <head>tSoundFile destructor</head>
        <body>
          <short>Closes the tSoundFile object.</short>

          <definition lang="pascal">destructor destroy;</definition>
          <definition lang="c++">~tSample(void);</definition>

          <important>
            <item>Destructor doesn't close the files if the file source is of the type tStream.</item>
            <item>This Destructor needs to be called before closing the <topic id="class_tsoundcollection">tSoundCollection</topic>
            object above!</item>
          </important>

          <seealso>
            <item><topic id="tsf_constructor"/></item>
          </seealso>
        </body>
      </helpitem>

    </chapter>


    <chapter id="chapter_tsample">
      <head>class tSample</head>

      <helpitem id="class_tsample">
        <head>Class tSample</head>
        <body>
          <short>This class makes sound streams static (loads them completely to memory). TSample extends <topic id="class_tsoundstream"/>.</short>
          <additional>
          TSample adds additional functions to the preceding class, mainly to control sound loops.

          Methods in this class:<br/>
          <ul>
            <li><topic id="tsample_constructor"/> -- Create object, load sample data</li>
            <li><topic id="tsample_destructor"/> -- Close object, unload sample data</li>
            <li><topic id="tsample_setloop"/> -- Set loop within sample data</li>
          </ul>
          </additional>
        </body>
      </helpitem>
      <helpitem id="tsample_constructor">
        <head>tSample constructor</head>
        <body>

          <short>Creates a sample from a stream or from memory.</short>

          <additional>
          Loading from stream:<br/>
          <keyword>Stream</keyword> holds a sound source of the type <topic id="class_tsoundstream">tSoundStream</topic>. You can destroy the stream after loading it to the
					sample, since all stream data is being loaded to memory. All files which can be loaded to a stream can act as a source for tSample.<br/>
          <br/>
          Loading from memory:<br/>
					<keyword>Sampledata</keyword> points to the sample buffer. All contained data will be copied into
					an internal buffer, so you can dispose your buffer after initialization. <keyword>Samples</keyword> specifies the number of <topic id="sample">samples</topic> 
					in your buffer. <keyword>Flags</keyword> specify the type of sound information in the buffer by using the same flags as <topic id="tsi_startplayback"/>. 
					<keyword>Frequency</keyword> specifies the frequency of the sample data.<br/>
					Channel arrangements: L,R always first, C if format has center channel (5.1,6.1,7.1), then LSurround/RSurround, Csurround if format has surround center (6.1), then
					Lside/Rside (if 7.1). LFE channel is always last (if included).
					</additional>

          <definition lang="pascal">constructor create(dest : <topic id="class_tsoundcollection">tSoundCollection</topic>;source : <topic id="class_tsoundstream">tSoundStream</topic>);</definition>
          <definition lang="pascal">constructor create(dest : <topic id="class_tsoundcollection">tSoundCollection</topic> sampledata : pointer; samples, flags, channels, frequency : longword);</definition>
          <definition lang="c++">tSample(<topic id="class_tsoundcollection">tSoundCollection</topic> *sound,<topic id="class_tsoundstream">tSoundStream</topic> *stream);</definition>
          <definition lang="c++">tSample(<topic id="class_tsoundcollection">tSoundCollection</topic>  *sound, void *sampledata, unsigned int <topic id="sample">samples</topic>, unsigned int flags, unsigned int channels, unsigned int frequency);</definition>

          <important>
            <item>Currently only 8 and 16 bits sample data are supported for direct load from memory.</item>
            <item><keyword>Dest</keyword> is an object of <topic id="class_tsoundcollection">tSoundCollection</topic>, which has to be initialized before
            you initialize tSample.</item>
          </important>
          <seealso>
            <item><topic id="tsample_destructor"/></item>
          </seealso>
        </body>

      </helpitem>

      <helpitem id="tsample_destructor">
        <head>tSample destructor</head>
        <body>
          <short>Closes the sample, deallocates used memory.</short>

          <definition lang="pascal">destructor destroy;</definition>
          <definition lang="c++">~tSample(void);</definition>

          <important>
            <item>This Destructor needs to be called before closing the <topic id="class_tsoundcollection">tSoundCollection</topic> object above!</item>
          </important>

          <seealso>
            <item><topic id="tsample_constructor"/></item>
          </seealso>
        </body>
      </helpitem>

      <helpitem id="tsample_setloop">
        <head>setLoop</head>
        <body>

        <short>Sets a loop within the sample.</short>

          <definition lang="pascal">procedure setLoop(start,stop : longword);</definition>
          <definition lang="c++">void setLoop(unsigned int start,unsigned int stop);</definition>

          <variables>If <keyword>start</keyword> and <keyword>stop</keyword> are set to zero, an existing loop
          will be removed.</variables>

          <important>
            <item>The values are NOT byte values, but <topic id="sample">sample</topic> values!</item>
            <item>If you set a loop, the sample won't stop until you called <topic id="tss_stop"/>!</item>
            <item>Setting positions out of the sound data will be ignored, the start
            position needs to be smaller than the end position.</item>
          </important>

        </body>
      </helpitem>

    </chapter>

    <chapter id="chapter_types">
      <head>Types used in SoundLib</head>

      <helpitem id="type_variables">
        <head>Variable types</head>
        <body>
          <short>Types used for type safe definitions.</short>
          <additional>
            <sourcecode lang="pascal">type
  sl_int8       = shortint;
  sl_uint8      = byte;
  sl_int16      = smallint;
  sl_uint16     = word;
  sl_int32      = longint;
  sl_uint32     = longword;
  sl_int64      = int64;
  sl_uint64     = int64;
  sl_bool       = longbool;
  pointerval    = longword;</sourcecode>
            <sourcecode lang="c++">  typedef signed char         sl_int8;
  typedef char                sl_uint8;
  typedef short int           sl_int16;
  typedef unsigned short int  sl_uint16;
  typedef long int            sl_int32;
  typedef unsigned long       sl_uint32;
  typedef long long           sl_int64;
  typedef long long           sl_uint64;
  typedef unsigned int        sl_bool;</sourcecode>
          </additional>
        </body>
      </helpitem>

      <helpitem id="type_tsvector">
        <head>Type tSVector</head>
        <body>
          <short>3D vector used for sound positioning in 3D environments.</short>
          <additional>
          </additional>

          <definition lang="pascal">tSVector = array[0..2] of double;</definition>
          <definition lang="c++">typedef double tSVector[3];</definition>
        </body>
      </helpitem>

      <helpitem id="type_tsounddeviceinfo">
        <head>type tSoundDeviceInfo</head>
        <body>
          <short>Contains information about sound devices.</short>
          <additional>
          <sourcecode lang="pascal">  tSoundDeviceInfo = packed record
    deviceName  : pchar;
    frequencies : record
      play : record
        min,max,preferred : sl_uint32;
      end;
    end;
    outputchannels : sl_uint32;
    lfe            : sl_bool;
    flags          : sl_uint32;
    version        : sl_uint32;
    wavetablesize  : sl_uint32;
    minbufsize,
    maxbufsize     : sl_uint32;
  end; </sourcecode>
          <sourcecode lang="c++">  struct tSoundDeviceInfo 
  {
    char* deviceName;
    sl_uint32 frequencies_play_min;
    sl_uint32 frequencies_play_max;
    sl_uint32 frequencies_play_preferred;
    sl_uint32 outputchannels;
    sl_bool   LFE;
    sl_uint32 flags;
    sl_uint32 version;
    sl_uint32 wavetablesize;
    sl_uint32 minbufsize;
    sl_uint32 maxbufsize;
  };  </sourcecode>
          </additional>
        </body>
      </helpitem>

      <helpitem id="type_tsoundinterfaceinfo">
        <head>type tSoundInterfaceInfo</head>
        <body>
          <short>Contains information about sound interfaces.</short>
          <additional>
		        <sourcecode lang="pascal">  tSoundInterfaceInfo = packed record
    interfaceName     : pchar;      // Name of interface
    interfaceVersion  : pchar;      // Version of SL interface driver
    priority          : sl_int32;   // Priority of this interface (for auto selection)
    flags             : sl_uint32;  // stores information about interface
    physical          : sl_bool;    // True if physical device; false for null output
  end;</sourcecode>
		        <sourcecode lang="c++">  struct tSoundInterfaceInfo 
  {
    char*           interfaceName;    // Name of interface
    char*           interfaceVersion; // Version of SL interface driver
    sl_int32        priority;         // Priority of this interface (for auto selection)
    sl_uint32       flags;            // stores information about interface
    sl_uint32       physical;         // True if physical device; false for null output
  };
</sourcecode>
    			</additional>
        </body>
      </helpitem>

      <helpitem id="type_tplaybackinfo">
        <head>type tPlaybackInfo</head>
        <body>
          <short>Contains information about current playback parameters.</short>
          <additional>
		        <sourcecode lang="pascal">  tPlaybackInfo = packed record
    frequency       : sl_uint32;  // Playback frequency
    resolution      : sl_uint32;  // Playback resolution
    outSamplesize   : sl_uint32;
    inSamplesize    : sl_uint32;
    is_fp           : sl_bool;    // Mixer uses floating point single values
    inchannels      : sl_uint32;  // Number of input channels for playback
    outchannels     : sl_uint32;  // Number of output playback channels
    lfe             : sl_bool;    // If true, last in/outchannel is an LFE channel
    buffersize      : sl_uint32;  // Size of playback mixing buffer in samples
    buffers         : sl_uint32;  // Number of buffers for playback
  end;</sourcecode>
		        <sourcecode lang="c++">  struct tPlaybackInfo
  {    
    unsigned int  frequency;     // Playback frequency
    unsigned int  resolution;    // Playback resolution
    unsigned int  outSamplesize;
    unsigned int  inSamplesize;
    unsigned int  is_fp;         // Playback uses floating point values
    unsigned int  inchannels;    // Number of input channels for playback
    unsigned int  outchannels;   // Number of output playback channels
    unsigned int  LFE;           // If true, last in/outchannel is an LFE channel 
    unsigned int  buffersize;    // Size of playback mixing buffer in samples
    unsigned int  buffers;       // Number of buffers for playback
  };</sourcecode>
    			</additional>
        </body>
      </helpitem>

      <helpitem id="type_tsoundinfo">
        <head>type tSoundInfo</head>
        <body>
          <short>Contains information about the sound stream.</short>
          <additional>
          <sourcecode lang="pascal">  tSoundinfo = packed record
    name        : pchar;      // Name of the sound or song
    creator     : pchar;      // Creator of that sound or song
    encoder     : pchar;      // Encoder/Creation Software string
    info        : pchar;      // Additional info field if available
    length      : sl_uint64;  // Length of sound or song in samples
    frequency   : sl_uint32;  // Original playback frequency of that sound
    is_fp       : sl_bool;    // Floating point single values
    resolution  : sl_uint32;  // Resolution of sound data
    channels    : sl_int32;   // Number of channels this sound contains
    samplesize  : sl_uint32;  // Size of a sample in bytes
    buffersize  : sl_uint32;  // Stream buffer request size in samples
  end;</sourcecode>
          <sourcecode lang="c++">  struct tSoundInfo
  {
    char* name;               // Name of the sound or song   
    char* creator;            // Creator of that sound or song             
    char* encoder;            // Encoder/Creation Software string          
    char* info;               // Additional info field if available        
    sl_uint64 length;         // Length of sound or song in samples        
    sl_uint32 frequency;      // Original playback frequency of that sound 
    sl_uint32 is_fp;          // Floating point single values
    sl_uint32 resolution;	    // Resolution of sound data                  
    sl_int32  channels;       // Number of channels this sound contains    
    sl_uint32 samplesize;     // Size of a sample in bytes
    sl_uint32 buffersize;     // Stream buffer request size in samples
  };</sourcecode>

          </additional>
          <important>
            <item>The length of the stream will be -1 if length can't be determined (e.g. if it's a broadcasted stream)</item>
          </important>

          <seealso>
            <item><topic id="tss_getinfo"/></item>
          </seealso>
        </body>
      </helpitem>


		</chapter>

  </chapters>

</helpfile>