getSoundLength
Shared
Returns the sound's length.
float|false getSoundLength(sound sound)
Parameters
| Name | Type | Description |
|---|---|---|
| sound | sound | The sound element. On the client a dui element also works, for the browser's sound. |
Returns
The length in seconds, or false if the sound was not found.
Example
local music = playSound("sounds/track.mp3")
outputDebugString(("Duration: %.1f s"):format(getSoundLength(music)))