Description
Plays given CfgSounds sound or a sound file given by file path through a dedicated UI sound channel unaffected by the global mixer volumes. If the file path is given, the leading slash will be ignored. To stop the sound use stopSound
Syntax
playSoundUI [sound, volume, soundPitch, isEffect, offset, loop]
Parameters:
sound: String - CfgSounds class or file as used in playSound3D (see Arma 3: Sound Files for available file names)volume: Number - (Optional, default 1) sound volume clamped in range 0..5soundPitch: Number - (Optional, default 1)- 1.0 → normal
- 0.5 → Darth Vader
- 2.0 → Chipmunks
isEffect: Boolean - (Optional, default false) if true, diverts sound through effects channel (see fadeSound, soundVolume)offset: Number - (Optional, default 0) offset in seconds. Same as with playSound3D (ignored if sound is set to 'loop') (since arma3 2.12)loop: Boolean - (Optional, default false) If true the sound will loop forever. Use stopSound to stop (since arma3 2.22)
Returns: Number - id of the sound (0..65535) since Arma 3 v2.12 (was Nothing before that)
Examples
Example 1
playSoundUI ["Alarm", 0.5, 0.5];
Example 2
playSoundUI ["A3\Sounds_F\sfx\blip1.wss"];
Example 3
Sound file extension must be specified even if a config entry has none:
playSoundUI ["A3\Sounds_F\sfx\alarm_independent", 5, 1]; // no sound
playSoundUI ["A3\Sounds_F\sfx\alarm_independent.wss", 5, 1]; // alarm
See also
stopSound · soundParams · say3D · playSound · say2D · say · createSoundSource · setRandomLip · getMissionPath · playSound3D