Skip to content

EmitSound

Narta Xaymar Dirks edited this page Nov 1, 2026 · 7 revisions
Blitz3D

EmitSound

EmitSound:Int32 sound:Int32, entity:Int32
Parameter Mode Type Default Description
sound In Int32 required A sound handle.
entity In Int32 required The entity the sound comes from.

Returns: A channel handle for the playing sound.

Description

Plays a sound from an entity, which becomes quieter and more to one side the further away the entity is from the listener, and keeps following the entity while the sound plays. The sound should come from Load3DSound. The volume and side are right from the first sample. Without a CreateListener the listener is at the origin with a rolloff, doppler and distance factor of 1, and when the entity is freed the sound stays where it was. The returned channel can be stopped or changed with the usual channel commands.

The example is the one under CreateListener.

Differences

  • 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.

Related Commands

CreateListener

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally