func_audio_setchannelvolume.rst 712 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .. _func_audio_setchannelvolume:
  2. ================
  3. SetChannelVolume
  4. ================
  5. SetChannelVolume -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. SetChannelVolume( channel:TChannel,volume# )
  10. Set playback volume of an audio channel
  11. @volume should be in the range 0 (silent) to 1 (full volume)
  12. Parameters
  13. ==========
  14. Return Values
  15. =============
  16. Nothing.
  17. Examples
  18. ========
  19. .. code-block:: blitzmax
  20. ' setchannelvolume.bmx
  21. timer=CreateTimer(20)
  22. sound = LoadSound ("shoot.wav")
  23. For volume#=.1 To 2 Step .05
  24. WaitTimer timer
  25. channel=CueSound(sound)
  26. SetChannelVolume channel,volume
  27. ResumeChannel channel
  28. Next
  29. See Also
  30. ========