Garry's Mod Wiki

Revision Difference

Global.SoundDuration#562499

<function name="SoundDuration" parent="Global" type="libraryfunc"> <description> Returns the duration of the specified sound in seconds. ⤶ <bug issue="936">This function does not return the correct duration on MacOS and Linux, or if the file is a non-.wav file on Windows.⤶ ⤶ This is fixed in the next update.</bug>⤶ Returns the approximate duration of the specified sound in seconds, for `.wav` and `.mp3` sounds. </description> <realm>Shared</realm> <args> <arg name="soundName" type="string">The sound file path.</arg> </args> <rets> <ret name="" type="number">Sound duration in seconds.</ret> </rets> </function>