Difference between revisions of "SNDLOOP"

From QB64 Wiki
Jump to navigation Jump to search
imported>SMcNeill
imported>SMcNeill
(style guidelines)
 
Line 4: Line 4:
  
 
{{PageSyntax}}
 
{{PageSyntax}}
::: '''_SNDLOOP''' {{Parameter|handle&}}
+
: [[_SNDLOOP]] {{Parameter|handle&}}
  
  
 
{{PageDescription}}
 
{{PageDescription}}
*Plays the sound, looping it.
+
*Plays the sound identified by {{Parameter|handle&}} in a loop.
  
  
 +
{{PageExamples}}
 
''Example:'' Loading a sound or music file and playing it in a loop until a key is pressed.
 
''Example:'' Loading a sound or music file and playing it in a loop until a key is pressed.
 
{{CodeStart}} '' ''
 
{{CodeStart}} '' ''

Latest revision as of 13:50, 9 September 2017

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.


Examples

Example: 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



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page