1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 06:15:52 +00:00
QB64-PE/internal/help/_SNDPLAYCOPY.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
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.
2014-09-22 08:19:03 -04:00

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&amp;}}[, {{Parameter|volume!}}]
{{PageDescription}}
* Opened sound files must have the &quot;SYNC&quot; 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 &quot;VOL&quot; 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&amp;, 0.5
{{CodeEnd}}
''Example 2:'' Playing a song at random volumes.
{{CodeStart}}
chomp&amp; = _SNDOPEN(&quot;chomp.wav&quot;, &quot;VOL,SYNC&quot;)
_SNDPLAYCOPY chomp&amp;, 0.5 + RND * 0.49
{{CodeEnd}}
{{PageSeeAlso}}
*{{KW|_SNDOPEN}}
*{{KW|_SNDCOPY}}
{{PageNavigation}}