SoundPitch.htm 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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>SoundPitch sound_variable, hertz</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. sound_variable = any valid sound variable previously created with the LoadSound command. <br />
  13. <br />
  14. hertz = valid playback hertz speed (up to 44000 hertz).
  15. </td>
  16. </tr>
  17. </table>
  18. <h1>Description</h1>
  19. <table>
  20. <tr>
  21. <td>
  22. Alters the pitch of a sound previously loaded with the LoadSound command. By changing the pitch, you can often reuse sounds for different uses or to simulate a 'counting up/down' sound. To make the sound 'higher pitched', increase the hertz. Conversely, decreasing the hertz will 'lower' the pitch. Note: this is in relation to the original hertz frequency of the sound.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/SoundPitch.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; Load the sound (11,000 hertz) <br />
  31. <br />
  32. snd1Up = LoadSound("audiooneup.wav") <br />
  33. <br />
  34. ; Play the sound normally <br />
  35. PlaySound snd1Up <br />
  36. <br />
  37. ; Change the pitch UP and play it <br />
  38. SoundPitch snd1Up, 11000*2 ;twice original frequency <br />
  39. PlaySound snd1Up <br />
  40. <br />
  41. ; Change the pitch down and play it <br />
  42. SoundPitch snd1Up, 11000/2 ;1/2 original frequency <br />
  43. PlaySound snd1Up
  44. </td>
  45. </tr>
  46. </table>
  47. <br>
  48. <a target=_top href=../index.htm>Index</a><br>
  49. <br>
  50. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=SoundPitch&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  51. </html>