Skip to content

SoundRange

Narta Xaymar Dirks edited this page Dec 2, 2026 · 1 revision

SoundRange BlitzLLVM

SoundRange:Void sound:Int32, near:Float32, far:Float32
Parameter Mode Type Default Description
sound In Int32 required A sound handle from Load3DSound.
near In Float32 required Up to this distance, in units of the world, the sound plays at full volume.
far In Float32 required From this distance on, in units of the world, the sound is silent. 0 is no end. Otherwise it has to be past near.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

Gives the 3D sounds that a sound starts from now on a range: full volume up to the near distance, a falloff between the two, and silence from the far distance on. Channels that already play keep theirs, see ChannelRange. This is a BlitzLLVM extension.

Differences

  • 0, 0 (the default) is no range, the falloff of the original. How the volume falls between the two is described at ChannelRange. Distances below 0, or a far distance that is not past the near one, are a runtime error. The 0 of a sound that failed to load is ignored.

Examples

; Every bird that sings can be heard from 60 units away at most.
song = Load3DSound("bird.ogg")
SoundRange song, 2, 60
For bird.Bird = Each Bird
	EmitSound song, bird\entity
Next

Related Commands

ChannelRange BlitzLLVM, EmitSound Blitz3D, GetChannelRangeFar BlitzLLVM, GetChannelRangeNear BlitzLLVM, GetSoundRangeFar BlitzLLVM, GetSoundRangeNear BlitzLLVM, GetSpeedOfSound BlitzLLVM, SpeedOfSound BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally