mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-26 17:55:52 +00:00
6e01fc8dce
Added new _STRCMP and _STRICMP commands for quick string comparisons. Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders. Altered UCASE and LCASE routines to be faster in some situations for us.
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
The {{KW|_SNDPLAYCOPY}} statement copies a sound, plays it and automatically closes the copy using a handle parameter passed from {{KW|_SNDOPEN}} or {{KW|_SNDCOPY}}
|
|
|
|
|
|
{{PageSyntax}}
|
|
:{{KW|_SNDPLAYCOPY}} {{Parameter|handle&}}[, {{Parameter|volume!}}]
|
|
|
|
|
|
|
|
{{PageDescription}}
|
|
* Opened sound files must have the "SYNC" capability to use this statement. (Currently WAV, OGG, AIF, RIF and VOC)
|
|
* The volume parameter can be any {{KW|SINGLE}} value from 0 (no volume) to 1 (full volume).
|
|
*Makes coding easier by doing all of the following automatically:
|
|
:#Copies/duplicates the source handle (see {{KW|_SNDCOPY}})
|
|
:#Changes the volume of the copy if volume is passed (file must have "VOL" capability)
|
|
:#Plays the copy
|
|
:#Closes the copy
|
|
* This statement is a better choice than {{KW|_SNDPLAYFILE}} if the sound will be played often, reducing the burden on computer.
|
|
|
|
|
|
''Example 1:'' Playing a sound at half volume.
|
|
|
|
{{CodeStart}}
|
|
|
|
{{Cl|_SNDPLAYCOPY}} applause&, 0.5
|
|
|
|
{{CodeEnd}}
|
|
|
|
|
|
''Example 2:'' Playing a song at random volumes.
|
|
|
|
{{CodeStart}}
|
|
|
|
chomp& = _SNDOPEN("chomp.wav", "VOL,SYNC")
|
|
|
|
_SNDPLAYCOPY chomp&, 0.5 + RND * 0.49
|
|
|
|
{{CodeEnd}}
|
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
|
|
*{{KW|_SNDOPEN}}
|
|
*{{KW|_SNDCOPY}}
|
|
|
|
|
|
{{PageNavigation}} |