LoadSound.htm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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>LoadSound (filename$)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. filename$ - name of sound file. Formats supported: raw/wav/mp3/ogg
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This command loads a sound file into memory. It returns a number if successful, or 0 if there was a problem loading the sound. You must assign the value this returns to a variable (preferably a Global variable) for subsequent playback using (PlaySound). Look at the example.
  21. </td>
  22. </tr>
  23. </table>
  24. <h1><a href=../2d_examples/LoadSound.bb>Example</a></h1>
  25. <table>
  26. <tr>
  27. <td>
  28. ; Assign a global variable for the sound <br />
  29. Global sndPlayerDie <br />
  30. <br />
  31. ; Load the sound file into memory <br />
  32. <br />
  33. sndPlayerDie=LoadSound("sounds/die.wav") <br />
  34. <br />
  35. ; Play the sound <br />
  36. <br />
  37. PlaySound sndPlayerDie <br />
  38. </td>
  39. </tr>
  40. </table>
  41. <br>
  42. <a target=_top href=../index.htm>Index</a><br>
  43. <br>
  44. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=LoadSound&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  45. </html>