Jump to navigation Jump to search
Revision as of 03:16, 1 November 2017 by (1 revision imported)
- _SNDPLAYCOPY handle&[, volume!]
- The LONG handle& value is returned by _SNDOPEN using a specific sound file.
- The volume! parameter can be any 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 _SNDCOPY).
- Changes the volume of the copy if volume is passed.
- Plays the copy.
- Closes the copy.
- This statement is a better choice than _SNDPLAYFILE if the sound will be played often, reducing the burden on the computer.
Example 1: Playing a previously opened sound at half volume.
_SNDPLAYCOPY applause&, 0.5
Example 2: Playing a song at random volumes.
chomp& = _SNDOPEN("chomp.wav") _SNDPLAYCOPY chomp&, 0.5 + RND * 0.49