soundParams: Difference between revisions
Killzone Kid (talk | contribs) No edit summary |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
| Line 10: | Line 10: | ||
|s1= [[soundParams]] id | |s1= [[soundParams]] id | ||
|p1= id: [[Number]] - id returned by [[playSoundUI]] and [[playSound3D]] commands, -1 to return all | |p1= id: [[Number]] - id returned by [[playSoundUI]] and [[playSound3D]] commands, -1 to return all currently playing ids | ||
|r1= [[Array]] in format [path, curPos, length, time, volume], where: | |r1= | ||
* path: [[String]] - the path to the played sound file | * ''id'' != -1: [[Array]] in format [path, curPos, length, time, volume], where: | ||
* curPos: [[Number]] - current play position in 0...1 range | ** path: [[String]] - the path to the played sound file | ||
* length: [[Number]] - total sound duration in seconds | ** curPos: [[Number]] - current play position in 0...1 range | ||
* time: [[Number]] - time passed since the start of playback | ** length: [[Number]] - total sound duration in seconds | ||
* volume: [[Number]] - playback volume | ** time: [[Number]] - time passed since the start of playback | ||
* loop: [[Boolean]] - [[true]] if the sound is looping | ** volume: [[Number]] - playback volume | ||
** {{GVI|arma3|2.22|size= 0.75}} loop: [[Boolean]] - [[true]] if the sound is looping | |||
* {{GVI|arma3|2.22|size= 0.75}} ''id'' == -1: [[Array]] in format [sid1, sid2, sid3..., sidn], where sid is sound id returned by [[playSoundUI]] and [[playSound3D]] | |||
|x1= <sqf>_params = soundParams 10;</sqf> | |x1= <sqf>private _params = soundParams 10;</sqf> | ||
|x2= Wait for sound to end: | |||
<sqf> | <sqf> | ||
private _sound = playSound3D ["A3\Sounds_F\sfx\blip1.wss", player]; | private _sound = playSound3D ["A3\Sounds_F\sfx\blip1.wss", player]; | ||
waitUntil { soundParams _sound isEqualTo [] }; | waitUntil { soundParams _sound isEqualTo [] }; | ||
</sqf> | </sqf> | ||
|seealso= [[playSoundUI]] [[playSound3D]] [[stopSound]] | |||
}} | }} | ||
Latest revision as of 18:39, 21 November 2025
Description
- Description:
- Returns various params for the given sound
- Groups:
- Sounds
Syntax
- Syntax:
- soundParams id
- Parameters:
- id: Number - id returned by playSoundUI and playSound3D commands, -1 to return all currently playing ids
- Return Value:
-
- id != -1: Array in format [path, curPos, length, time, volume], where:
2.22 id == -1: Array in format [sid1, sid2, sid3..., sidn], where sid is sound id returned by playSoundUI and playSound3D
Examples
- Example 1:
- Example 2:
- Wait for sound to end:
Additional Information
- See also:
- playSoundUI playSound3D stopSound
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note