func_audio_setchanneldepth.rst 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. _func_audio_setchanneldepth:
  2. ===============
  3. SetChannelDepth
  4. ===============
  5. SetChannelDepth -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. SetChannelDepth( channel:TChannel,depth# )
  10. Set surround sound depth of an audio channel
  11. @depth should be in the range -1 (back) to 1 (front)
  12. Parameters
  13. ==========
  14. Return Values
  15. =============
  16. Nothing.
  17. Examples
  18. ========
  19. .. code-block:: blitzmax
  20. ' setchanneldepth.bmx
  21. Graphics 640, 480
  22. channel = AllocChannel ()
  23. sound = LoadSound ("shoot.wav") ' Use a short sample...
  24. Repeat
  25. If MouseHit(1) PlaySound sound,channel
  26. pan# = MouseX () / (640 / 2.0) - 1
  27. depth# = MouseY () / (480 /2.0) -1
  28. SetChannelPan channel,pan
  29. SetChannelDepth channel,depth
  30. Cls
  31. DrawText "Click to play...", 240, 200
  32. DrawText "Pan : " + pan, 240, 220
  33. DrawText "Depth : " + depth, 240, 240
  34. Flip
  35. Until KeyHit (KEY_ESCAPE)
  36. End
  37. See Also
  38. ========