48 lines
1.3 KiB
HTML
48 lines
1.3 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>PlaySound ( sound_variable )</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
sound_variable = variable previously assigned with a LoadSound command.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
This plays a sound previously loaded and assigned to a variable using the LoadSound command. See example.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
You will need to assign a channel variable handle to the sound when you play it. All subsequent sound handling commands require you use the CHANNEL variable, not the sound variable to control the sound - such as StopChannel, PauseChannel, ResumeChannel, ChannelPitch, ChannelVolume, ChannelPan, and ChannelPlaying.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/PlaySound.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; Assign a global variable for the sound
|
|
<br />
|
|
Global sndPlayerDie
|
|
<br />
|
|
|
|
<br />
|
|
; Load the sound file into memory
|
|
<br />
|
|
|
|
<br />
|
|
sndPlayerDie=LoadSound("sounds/die.wav")
|
|
<br />
|
|
|
|
<br />
|
|
; Play the sound
|
|
<br />
|
|
|
|
<br />
|
|
chnDie=PlaySound ( sndPlayerDie )
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=PlaySound&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|