Skip to content

LoopSound

Narta Xaymar Dirks edited this page Nov 27, 2026 · 9 revisions

LoopSound BlitzBasic

LoopSound:Void sound:Int32
Parameter Mode Type Default Description
sound In Int32 required A handle from LoadSound.

Description

Marks a sound so that it plays in an endless loop whenever it is played from now on. It does not start the sound: call PlaySound for that. Channels that already play the sound are not changed. Stop a looping sound with StopChannel.

Differences

  • There is no command to switch looping off again.
  • A debug build (-d) stops the program when the sound is 0 (a sound that failed to load) or does not exist, other builds ignore the command, see Debug handle checks.

Examples

; MakeBeep writes beep.wav, see the LoadSound example for the code.
Local snd = LoadSound("beep.wav")
LoopSound snd
Local ch = PlaySound(snd)
Delay 1800
StopChannel ch

Related Commands

FreeSound BlitzBasic, Load3DSound Blitz3D, LoadSound BlitzBasic, PlaySound BlitzBasic, SoundBus BlitzLLVM, SoundPan BlitzBasic, SoundPitch BlitzBasic, SoundVolume BlitzBasic

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally