1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/_SNDLOOP.md
2022-12-24 21:14:48 -06:00

625 B

The _SNDLOOP statement is like _SNDPLAY but the sound is looped. Uses a handle from the _SNDOPEN function.

Syntax

_SNDLOOP handle&

Description

  • Plays the sound identified by handle& in a loop.

Example(s)

Loading a sound or music file and playing it in a loop until a key is pressed.


bg = _SNDOPEN("back.ogg") '<<<<<<<<<< change to your sound file name
_SNDLOOP bg

DO
    _LIMIT 10   'keep CPU resources used low
LOOP UNTIL INKEY$ <> "" 'key press program exit
_SNDSTOP bg
_SNDCLOSE bg 

See Also