<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>Sound</title>
    <category>Effects</category>
    <version>5.1 OC</version>
    <syntax>
      <rtype>bool</rtype>
      <params>
        <param>
          <type>string</type>
          <name>name</name>
          <desc>Name of the sound effect (without .wav extension). If the referenced file is a .ogg file then the extension needs to be provided.</desc>
        </param>
        <param>
          <type>bool</type>
          <name>global</name>
          <desc>Specifies wether the sound is played globally, i.e. independently of the object position always with the same loudness.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>volume</name>
          <desc>0-100: volume for playback of the sound. A volume value of <code>nil</code> means playback at 100.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>player</name>
          <desc>Player number of the player for which the sound is to be played. In network games, the sound will thus not be audible for the other players. If <code>nil</code> (or not specified), the sound will be played for all players.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>loop_count</name>
          <desc>Increases or decreases the number of sounds running in a continuous loop. Value +1 will play this sound indefinitely until it is stopped by calling this function again with value -1. Value 0 will play the sound once normally.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Plays a sound. The specified sound file has to be available in the group Sound.ocg, in the active scenario file, or in any loaded object definition. The audibility of object local sounds will depend on the position of the object relative to the visible viewports.</desc>
    <examples>
      <example>
        <code><funclink>FindObject</funclink>(<funclink>Find_ID</funclink>(WindGenerator))-&gt;Sound(&quot;Fanfare&quot;, false, 50);</code>
        <text>Plays a 'Fanfare' sound next to the first found wind generator at half volume.</text>
      </example>
    </examples>
    <related><funclink>Music</funclink></related>
  </func>
  <author>Sven2</author><date>2002-08</date>
</funcs>
