setchanneldepth.bmx 465 B

12345678910111213141516171819202122232425
  1. ' setchanneldepth.bmx
  2. Graphics 640, 480
  3. channel = AllocChannel ()
  4. sound = LoadSound ("shoot.wav") ' Use a short sample...
  5. Repeat
  6. If MouseHit(1) PlaySound sound,channel
  7. pan# = MouseX () / (640 / 2.0) - 1
  8. depth# = MouseY () / (480 /2.0) -1
  9. SetChannelPan channel,pan
  10. SetChannelDepth channel,depth
  11. Cls
  12. DrawText "Click to play...", 240, 200
  13. DrawText "Pan : " + pan, 240, 220
  14. DrawText "Depth : " + depth, 240, 240
  15. Flip
  16. Until KeyHit (KEY_ESCAPE)
  17. End