Files
QtGameMaker/help/files/408_02_sounds.html
T

59 lines
1.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sounds</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Sounds</h3>
The following functions will give you information about a sound:
<p>
<blockquote>
<tt><b>sound_exists(ind)</b></tt>
Returns whether a sound with the given index exists.<br>
<tt><b>sound_get_name(ind)</b></tt>
Returns the name of the sound with the given index.<br>
<tt><b>sound_get_kind(ind)</b></tt>
Returns the kind of the sound with the given index (0=normal, 1=background, 2=3d, 3=mmplayer).<br>
<tt><b>sound_get_preload(ind)</b></tt>
Returns whether the sound with the given index has preload set.
</blockquote>
<p>
Sounds use many resources and most systems can store and play only a limited number of sounds. If you
make a large game you would like to have more control over which sounds are loaded in audio memory at what
times. You can use the switch off the preload option for sounds to make sure sounds are only loaded when used.
This though has the problem that you might get a small hiccup when the sound is used first. Also,
sounds are not automatically unloaded when you don't need them anymore.
For more control you can use the following functions.
<p>
<blockquote>
<tt><b>sound_discard(index)</b></tt>
Frees the audio memory used for the indicated sound.<br>
<tt><b>sound_restore(index)</b></tt>
Restores the indicated sound in audio memory for immediate playing.<br>
</blockquote>
<p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
sound_exists()
sound_get_name()
sound_get_kind()
sound_get_preload()
sound_discard()
sound_restore()
-->