PlaySound.htm 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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>PlaySound ( sound_variable )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. sound_variable = variable previously assigned with a LoadSound command.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This plays a sound previously loaded and assigned to a variable using the LoadSound command. See example. <br />
  21. <br />
  22. 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.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/PlaySound.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; Assign a global variable for the sound <br />
  31. Global sndPlayerDie <br />
  32. <br />
  33. ; Load the sound file into memory <br />
  34. <br />
  35. sndPlayerDie=LoadSound("sounds/die.wav") <br />
  36. <br />
  37. ; Play the sound <br />
  38. <br />
  39. chnDie=PlaySound ( sndPlayerDie )
  40. </td>
  41. </tr>
  42. </table>
  43. <br>
  44. <a target=_top href=../index.htm>Index</a><br>
  45. <br>
  46. 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>
  47. </html>