FreeSound()

Syntax

FreeSound(#Sound)
Description
Stops and removes a sound previously loaded with LoadSound() or CatchSound() from memory. Once a sound has been freed, it can't be played anymore.

Parameters

#Sound The sound to free. If #PB_All is specified, all the remaining sounds are freed.

Return value

None.

Remarks

All remaining sounds are automatically freed when the program ends.

Example

 InitSound()           ; Initialize Sound system
 UseOGGSoundDecoder()  ; Use ogg files

 ; Loads a sound from a file
 LoadSound(0, #PB_Compiler_Home +"Examples\3D\Data\Siren.ogg")
 ; The sound is playing 
 PlaySound(0, #PB_Sound_Loop)
 
 MessageRequester("Info", "Ok to stop.")
 
 FreeSound(0) ; The sound is freed
 End

Supported OS

All

<- CatchSound() - Sound Index - GetSoundFrequency() ->