2016-03-18 11:36:04 +00:00
|
|
|
{{DISPLAYTITLE:_SNDVOL}}
|
|
|
|
The [[_SNDVOL]] statement sets the volume of a sound using a handle from the [[_SNDOPEN]] Function.
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
2016-03-18 11:36:04 +00:00
|
|
|
::: '''_SNDVOL ('''{{Parameter|handle&}}, {{Parameter|volume!}}''')'''
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
{{PageDescription}}
|
|
|
|
*Volume is a value from 0 (silence) to 1 (full volume).
|
|
|
|
*An opened sound file must have the "VOL" capability to use this function.
|
2016-03-18 11:36:04 +00:00
|
|
|
{{TextStart}} QB64 supports the following sound file formats ('''Bold is a guaranteed capability'''):
|
2015-08-02 12:12:44 +00:00
|
|
|
|
2016-03-18 11:36:04 +00:00
|
|
|
WAV = "'''VOL,SYNC,LEN''',PAUSE" [http://www.rarewares.org/ogg-oggdropxpd.php Free WAV to OGG GUI converter]
|
|
|
|
OGG = "VOL,SYNC,LEN,PAUSE" [http://www.rarewares.org/ogg-oggenc.php Free WAV to OGG converter]
|
|
|
|
AIF = "VOL,SYNC,LEN,PAUSE"
|
|
|
|
RIF = "VOL,SYNC,LEN,PAUSE"
|
|
|
|
VOC = "VOL,SYNC,LEN,PAUSE"
|
|
|
|
MID = "'''VOL'''"
|
|
|
|
MOD = "VOL,PAUSE"
|
|
|
|
MP3 = "'''VOL''',PAUSE,SETPOS" [http://www.freemp3wmaconverter.com/index.html Free WMA, MP3 and OGG converter]
|
2015-08-02 12:12:44 +00:00
|
|
|
|
2016-03-18 11:36:04 +00:00
|
|
|
''Note:'' {{Cb|_SNDBAL}} only affects MP3 volume. Sound will reside in main channel.
|
|
|
|
{{TextEnd}}
|
|
|
|
|
|
|
|
|
|
|
|
''Example:''
|
2015-08-02 12:12:44 +00:00
|
|
|
{{CodeStart}} '' ''
|
|
|
|
h& = {{Cl|_SNDOPEN}}("bell.wav", "SYNC,VOL")
|
|
|
|
{{Cl|_SNDVOL}} h&, 0.5
|
|
|
|
{{Cl|_SNDPLAY}} h& '' ''
|
|
|
|
{{CodeEnd}}
|
|
|
|
|
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
|
|
*{{KW|_SNDOPEN}}, {{KW|_SNDBAL}}
|
|
|
|
|
|
|
|
|
|
|
|
{{PageNavigation}}
|