SNDLOOP - QB64 Wiki

SNDLOOP

From QB64 Wiki

Revision as of 16:25, 7 July 2012 by Clippy (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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, looping it.
  • _SNDSETPOS cannot be called while a looping sound is being played.


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

bg = _SNDOPEN("back.mid") '<<<<<<<<<< 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:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page