Skip to content

FreeSound

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

FreeSound

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

Description

Throws a loaded sound away and frees its memory. Channels that are playing this sound are stopped. Sounds are freed when the program ends anyway, so this is for programs that load a lot of sounds, for example one set for each level.

Differences

  • Using the handle of a sound that was freed stops the program with an error message, while 0 is accepted and ignored.

Examples

; MakeBeep writes beep.wav, see the LoadSound example for the code.
Local snd = LoadSound("beep.wav")
PlaySound snd
Delay 600
FreeSound snd

Related Commands

Load3DSound, LoadSound, LoopSound, PlaySound, SoundPan, SoundPitch, SoundVolume

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally