Description
Returns various params for the given sound. The sound has to be playing otherwise command returns empty array []. In case of say3D, the sound is put in the queue so unless the sound is started instantly with 'playMode' 1 or 2, it will also return [].
Syntax
soundParams id or sound
Parameters:
id: Number - id returned by playSoundUI and playSound3D commands, -1 to return all currently playing idssound: Object or NetObject - sound returned by say3D command or the unit, in which case current say3D unit's sound params are returned (since arma3 2.24)
Returns: - id != -1 : Array with [path, curPos, length, time, volume, source]
- path: String - the path to the played sound file
- curPos: Number - current play position in 0...1 range
- length: Number - total sound duration in seconds
- time: Number - time passed since the start of playback
- volume: Number - playback volume
- Arma 3 v2.22 loop: Boolean - true if the sound is looping
- Arma 3 v2.24 source: Object - Source object to which say3D sound is attached or objNull
- Arma 3 v2.22 id == -1: Array with [sid1, sid2, sid3..., sidn], where sid is sound id returned by playSoundUI and playSound3D but not say3D
Examples
Example 1
private _params = soundParams 10;
Example 2
Wait for sound to end:
private _sound = playSound3D ["A3\Sounds_F\sfx\blip1.wss", player];
waitUntil { soundParams _sound isEqualTo [] };