Garry's Mod Wiki

SoundDuration

  number SoundDuration( string soundName )

Description

Returns the duration of the specified sound in seconds.

This function does not return the correct duration on MacOS and Linux, or if the file is a non-.wav file on Windows.

Issue Tracker: 936

Arguments

1 string soundName
The sound file path.

Returns

1 number
Sound duration in seconds.