79 lines
2.2 KiB
HTML
79 lines
2.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>ChannelPan channel_handle, pan#</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
channel_handle = variable assigned to the channel when played
|
|
<br />
|
|
pan# = panning floating value to denote channel playback
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
When you want to do real sound panning effects, this is the command you'll use. This will allow you to pan the sound channels on a 'per channel' basis between the left and right speakers. This command makes it very easy to produce some really killer stereophonic effects!
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The pan value is between -1 and 1 with 0 being perfect center. -1 is full left, and 1 is full right. To make it somewhere in between, try -.5 for 50% left or .75 for 75% right.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/ChannelPan.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; Channel examples
|
|
<br />
|
|
|
|
<br />
|
|
Print "Loading sound ..."
|
|
<br />
|
|
; Load the sample - you'll need to point this to a sound on your computer
|
|
<br />
|
|
; For best results, make it about 5-10 seconds...
|
|
<br />
|
|
sndWave=LoadSound("level1.wav")
|
|
<br />
|
|
; Prepare the sound for looping
|
|
<br />
|
|
LoopSound sndWave
|
|
<br />
|
|
|
|
<br />
|
|
chnWave=PlaySound(sndWave)
|
|
<br />
|
|
|
|
<br />
|
|
Print "Playing sound for 2 seconds ..."
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Pausing sound for 2 seconds ..."
|
|
<br />
|
|
PauseChannel chnWave
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Restarting sound ..."
|
|
<br />
|
|
ResumeChannel chnWave
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Changing Pitch of sound ..."
|
|
<br />
|
|
ChannelPitch chnWave, 22000
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Playing new pitched sound ..."
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Left speaker only"
|
|
<br />
|
|
ChannelPan chnWave,-1
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "Right speaker only"
|
|
<br />
|
|
ChannelPan chnWave,1
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
Print "All done!"
|
|
<br />
|
|
StopChannel chnWave
|
|
<br />
|
|
|
|
</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=ChannelPan&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|