ChannelPan.htm 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>ChannelPan channel_handle, pan#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. channel_handle = variable assigned to the channel when played <br />
  13. pan# = panning floating value to denote channel playback
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. 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 />
  22. <br />
  23. 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.
  24. </td>
  25. </tr>
  26. </table>
  27. <h1><a href=../2d_examples/ChannelPan.bb>Example</a></h1>
  28. <table>
  29. <tr>
  30. <td>
  31. ; Channel examples <br />
  32. <br />
  33. Print "Loading sound ..." <br />
  34. ; Load the sample - you'll need to point this to a sound on your computer <br />
  35. ; For best results, make it about 5-10 seconds... <br />
  36. sndWave=LoadSound("level1.wav") <br />
  37. ; Prepare the sound for looping <br />
  38. LoopSound sndWave <br />
  39. <br />
  40. chnWave=PlaySound(sndWave) <br />
  41. <br />
  42. Print "Playing sound for 2 seconds ..." <br />
  43. Delay 2000 <br />
  44. <br />
  45. Print "Pausing sound for 2 seconds ..." <br />
  46. PauseChannel chnWave <br />
  47. Delay 2000 <br />
  48. <br />
  49. Print "Restarting sound ..." <br />
  50. ResumeChannel chnWave <br />
  51. Delay 2000 <br />
  52. <br />
  53. Print "Changing Pitch of sound ..." <br />
  54. ChannelPitch chnWave, 22000 <br />
  55. Delay 2000 <br />
  56. <br />
  57. Print "Playing new pitched sound ..." <br />
  58. Delay 2000 <br />
  59. <br />
  60. Print "Left speaker only" <br />
  61. ChannelPan chnWave,-1 <br />
  62. Delay 2000 <br />
  63. <br />
  64. Print "Right speaker only" <br />
  65. ChannelPan chnWave,1 <br />
  66. Delay 2000 <br />
  67. <br />
  68. Print "All done!" <br />
  69. StopChannel chnWave <br />
  70. </td>
  71. </tr>
  72. </table>
  73. <br>
  74. <a target=_top href=../index.htm>Index</a><br>
  75. <br>
  76. 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>
  77. </html>