forked from QB64-Phoenix-Edition/QB64pe
-
Notifications
You must be signed in to change notification settings - Fork 0
_SNDLOOP
Samuel Gomes edited this page Nov 8, 2022
·
1 revision
The _SNDLOOP statement is like _SNDPLAY but the sound is looped. Uses a handle from the _SNDOPEN function.
_SNDLOOP handle&
- Plays the sound identified by handle& in a loop.
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