Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:2.04

Description

Description:

Adjusts the audible distance of a sound source.

The volume the sound can be heard at, after executing this command, depends on the recorded loudness of the sound, as well as the environment and other ambient sounds. For instance, if distance is set to 100, it does not mean that the sound is heard 100 meters away. For quieter sounds, it may have to be set to 500 or even more, in order to be heard.

Syntax

Syntax:source setSoundSourceDistance distance
Parameters:
  • source : Object - Sound source.
  • distance: Number - Audible distance. If < 0.1 then the default distance of 1,000m is used.
Return Value:Nothing

Examples

Examples:
_sound = createSoundSource ["Alarm", player modelToWorld [0,100,0], [], 0]; // create a sound source
_sound setSoundSourceDistance 500; // set its distance to 500
Demo mission to show the effect of this command on different sound sources: soundDistance.zip

Additional Information

See also: createSoundSource, getSoundSourceDistance
Multiplayer:
Problems:

Notes