{"name":"playSound3D","operator":null,"title":"playSound3D","type":"command","url":"https://community.bistudio.com/wiki/playSound3D","revid":379065,"updated":"2026-09-24T20:28:32Z","groups":["Sounds"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Plays positional sound with given *filename* on every computer on network. To stop the sound use stopSound","syntaxes":[{"syntax":"playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset, local, loop]","since":null,"effect":null,"exec":null,"params":[{"name":"filename","type":"String","optional":false,"default":null,"description":"see Arma 3: Sound Files for available file names or #Example 3 to use mission files\n\n> [!IMPORTANT]\n> Since Arma 3 v2.10 the file name can start with a leading backslash `**\\**a3\\...`.\n>\n> However a leading backslash must **not** be used for an **addon** sound file.","types":["String"],"since":null,"text":"filename: String - see Arma 3: Sound Files for available file names or #Example 3 to use mission files\n\n> [!IMPORTANT]\n> Since Arma 3 v2.10 the file name can start with a leading backslash `**\\**a3\\...`.\n>\n> However a leading backslash must **not** be used for an **addon** sound file."},{"name":"soundSource","type":"Object","optional":false,"default":null,"description":"the object emitting the sound. If *soundPosition* below is specified this parameter is ignored","types":["Object"],"since":null,"text":"soundSource: Object - the object emitting the sound. If *soundPosition* below is specified this parameter is ignored"},{"name":"isInside","type":"Boolean","optional":true,"default":"false","description":"true to simulate a sound played inside a building or similar","types":["Boolean"],"since":null,"text":"isInside: Boolean - (Optional, default false) - true to simulate a sound played inside a building or similar"},{"name":"soundPosition","type":"PositionASL","optional":true,"default":"nil","description":"position for sound emitter, overrides *soundSource*. Object is also supported (see note below). Since Arma 3 v2.24 use nil to skip this param\n\n> [!NOTE]\n> If a following parameter has to be used, simply use `getPosASL _soundSource` for *soundPosition* instead of `_soundSource` for *soundSource*.\n\n> [!IMPORTANT]\n> This parameter also takes Object but their AGL position is used instead of ASL resulting in sound source being underground if they're above ground, always use PositionASL instead.","types":["PositionASL"],"since":null,"text":"soundPosition: PositionASL - (Optional, default nil) position for sound emitter, overrides *soundSource*. Object is also supported (see note below). Since Arma 3 v2.24 use nil to skip this param\n\n> [!NOTE]\n> If a following parameter has to be used, simply use `getPosASL _soundSource` for *soundPosition* instead of `_soundSource` for *soundSource*.\n\n> [!IMPORTANT]\n> This parameter also takes Object but their AGL position is used instead of ASL resulting in sound source being underground if they're above ground, always use PositionASL instead."},{"name":"volume","type":"Number","optional":true,"default":"1","description":"sound volume. A value greater than 5 gets capped","types":["Number"],"since":null,"text":"volume: Number - (Optional, default 1) sound volume. A value greater than 5 gets capped"},{"name":"soundPitch","type":"Number","optional":true,"default":"1","description":"1.0 → normal\n- 0.5 → Darth Vader\n- 2.0 → Chipmunks","types":["Number"],"since":null,"text":"soundPitch: Number - (Optional, default 1)\n- 1.0 → normal\n- 0.5 → Darth Vader\n- 2.0 → Chipmunks"},{"name":"distance","type":"Number","optional":true,"default":"0","description":"how far the sound is audible, in meters. `0` means no maximum distance","types":["Number"],"since":null,"text":"distance: Number - (Optional, default 0) how far the sound is audible, in meters. `0` means no maximum distance"},{"name":"offset","type":"Number","optional":true,"default":"0","description":"offset in seconds. Same as with playMusic (ignored if sound is set to play repeatedly, see 'loop')","types":["Number"],"since":"arma3 2.00","text":"offset: Number - (Optional, default 0) offset in seconds. Same as with playMusic (ignored if sound is set to play repeatedly, see 'loop')"},{"name":"local","type":"Boolean","optional":true,"default":"false","description":"if true the sound will not be broadcast over network","types":["Boolean"],"since":"arma3 2.06","text":"local: Boolean - (Optional, default false) if true the sound will not be broadcast over network"},{"name":"loop","type":"Boolean","optional":true,"default":"false","description":"if true the sound will repeat indefinitely. In MP, requires 'local' to be set to true. Use stopSound to stop.","types":["Boolean"],"since":"arma3 2.22","text":"loop: Boolean - (Optional, default false) if true the sound will repeat indefinitely. In MP, requires 'local' to be set to true. Use stopSound to stop."}],"returns":{"type":"Number","types":["Number"],"description":"id of the sound (0..65535) (was Nothing before Arma 3 v2.12)","text":"Number - id of the sound (0..65535) (was Nothing before Arma 3 v2.12)"},"form":"unary","operator":null,"left":null,"right":{"text":"[filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset, local, loop]","types":["Array"]}}],"examples":[{"text":"```sqf\nplaySound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player];\n```","code":["playSound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player];"]},{"text":"```sqf\nplaySound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player, false, getPosASL player, 1, 1, 0];\n```","code":["playSound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player, false, getPosASL player, 1, 1, 0];"]},{"text":"```sqf\nplaySound3D [getMissionPath \"mySound.ogg\", player]; // to play a mission directory sound\n```","code":["playSound3D [getMissionPath \"mySound.ogg\", player]; // to play a mission directory sound"]},{"text":"Sound file extension must be specified even if a config entry has none:\n\n```sqf\nplaySound3D [\"A3\\Sounds_F\\sfx\\alarm_independent\", player];        // no sound\nplaySound3D [\"A3\\Sounds_F\\sfx\\alarm_independent.wss\", player];    // alarm\n```","code":["playSound3D [\"A3\\Sounds_F\\sfx\\alarm_independent\", player];\t\t// no sound\nplaySound3D [\"A3\\Sounds_F\\sfx\\alarm_independent.wss\", player];\t// alarm"]},{"text":"Example 2 from Arma 3 v2.24 \n\n```sqf\nplaySound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player, false, nil, 1, 1, 0];\n```","code":["playSound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player, false, nil, 1, 1, 0];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["say3D","playSound","say2D","say","createSoundSource","setRandomLip","getMissionPath","playSoundUI","stopSound"],"notes":[{"user":"Killzone_Kid","date":"2014-09-26T09:18:00Z","text":"Currently, playSound3D is not JIP compatible, so joining players will not hear the sound if is started before and is still playing when player joins."},{"user":"Killzone_Kid","date":"2014-11-08T21:48:00Z","text":"When object is supplied but not a position, the position is taken from object, otherwise the position is taken from supplied position. That doesn't mean that when position is taken from object it is going to follow object when it changes position. The sound is generated at object position and it stays there.\n\nOne other important note: If *soundSource* param is objNull then this command develops the same bug with first person view as createSoundSource and say3D. If *soundSource* is player then the bug is inverted. It seems that passing vehicle player as *soundSource* param is the only way to make it behave correctly when vehicles involved."},{"user":"R3vo","date":"2020-10-07T12:24:00Z","text":"The sound will be distorted according to the <https://en.wikipedia.org/wiki/Doppler_effect> when passing by the sound source quickly."},{"user":"Hypoxic125","date":"2023-05-14T13:57:52Z","text":"Wait for sound to end:\n\n```sqf\nprivate _sound = playSound3D [\"A3\\Sounds_F\\sfx\\blip1.wss\", player];\nwaitUntil { soundParams _sound isEqualTo [] };\n```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Sounds","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Global Effect"]}