Garry's Mod Wiki

SoundDuration

  number SoundDuration( string soundName )

Description

Returns the approximate duration of the specified sound in seconds, for .wav and .mp3 sounds.

This function only works on mp3 files if the file is encoded with constant bitrate.

Arguments

1 string soundName
The sound file path.

Returns

1 number
Sound duration in seconds.