SNDVOL: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
(Add miniaudio backend specific enhancement)
 
(3 intermediate revisions by one other user not shown)
Line 10: Line 10:
* {{Parameter|volume!}} is a value from 0 (silence) to 1 (full volume).
* {{Parameter|volume!}} is a value from 0 (silence) to 1 (full volume).
* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"VOL" capability]] to use this function.
* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"VOL" capability]] to use this function.
* Version '''3.1.0''' enables this for '''"raw"''' sounds.




Line 16: Line 17:
h& = {{Cl|_SNDOPEN}}("bell.wav")
h& = {{Cl|_SNDOPEN}}("bell.wav")
{{Cl|_SNDVOL}} h&, 0.5
{{Cl|_SNDVOL}} h&, 0.5
{{Cl|_SNDPLAY}} h&  
{{Cl|_SNDPLAY}} h&
{{CodeEnd}}
{{CodeEnd}}




{{PageSeeAlso}}
{{PageSeeAlso}}
*[[_SNDOPEN]], [[_SNDBAL]]
* [[_SNDOPEN]], [[_SNDOPENRAW]]
* [[_SNDBAL]]




{{PageNavigation}}
{{PageNavigation}}
[[Category:Latest]]

Latest revision as of 01:39, 13 November 2023

The _SNDVOL statement sets the volume of a sound loaded in memory using a handle from the _SNDOPEN function.


Syntax

_SNDVOL handle&, volume!


Description

  • volume! is a value from 0 (silence) to 1 (full volume).
  • In versions prior to build 20170811/60, the sound identified by handle& must have been opened using the "VOL" capability to use this function.
  • Version 3.1.0 enables this for "raw" sounds.


Examples

h& = _SNDOPEN("bell.wav")
_SNDVOL h&, 0.5
_SNDPLAY h&


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link