Skip to content

Load3DSound

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

Load3DSound

Load3DSound:Int32 filename:String
Parameter Mode Type Default Description
filename In String required

Returns: A sound handle, or 0 if the file could not be loaded.

Description

Loads a sound file for use with EmitSound, which plays it from an entity so that it gets quieter with distance and moves between the speakers. The file formats are the same as for LoadSound.

Differences

  • See 3D Sound for what is simulated: volume falls off with the distance and the stereo position follows the angle to the listener, and the pitch is shifted when the sound or the listener moves (see CreateListener).

Examples

; MakeBeep writes beep.wav, see the LoadSound example for the code.
Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
Local cam = CreateCamera()
Local cube = CreateCube()
MoveEntity cube, 0, 0, 5
CreateListener cam
Local snd = Load3DSound("beep.wav")
EmitSound snd, cube
RenderWorld
Flip
Delay 600

Related Commands

FreeSound, LoadSound, LoopSound, PlaySound, SoundPan, SoundPitch, SoundVolume

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally