1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 03:01:21 +00:00
QB64-PE/internal/help/_SNDLOOP.txt

33 lines
804 B
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_SNDLOOP}}
The [[_SNDLOOP]] statement is like [[_SNDPLAY]] but the sound is looped. Uses a handle from the [[_SNDOPEN]] function.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: [[_SNDLOOP]] {{Parameter|handle&}}
{{PageDescription}}
2017-10-10 14:55:21 +00:00
*Plays the sound identified by {{Parameter|handle&}} in a loop.
2017-10-10 14:55:21 +00:00
{{PageExamples}}
''Example:'' Loading a sound or music file and playing it in a loop until a key is pressed.
{{CodeStart}} '' ''
2019-04-15 01:15:33 +00:00
bg = {{Cl|_SNDOPEN}}("back.ogg") '<<<<<<<<<< change to your sound file name
{{Cl|_SNDLOOP}} bg
DO
{{Cl|_LIMIT}} 10 'keep CPU resources used low
2019-04-15 01:15:33 +00:00
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'key press program exit
{{Cl|_SNDSTOP}} bg
{{Cl|_SNDCLOSE}} bg '' ''
{{CodeEnd}}
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[_SNDOPEN]], [[_SNDSTOP]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}
<