Find the length of a sound file

Is finding the duration of a sound file possible now that SoundDuration() is broken and the fix doesn’t seem to work?

You can try sound.PlayFile + http://wiki.garrysmod.com/page/IGModAudioChannel/GetLength

sound.playfile doesn’t seem to be a thing even though it is in the wiki



sound.PlayFile( "sound/" .. FilePath, "", soundchannel )


[ERROR] lua/autorun/gmmp.lua:235: attempt to call field ‘PlayFile’ (a nil value)

  1. Autoplayfunc - lua/autorun/gmmp.lua:235
  2. DoClick - lua/autorun/gmmp.lua:117
    3. unknown - lua/vgui/dlabel.lua:206

It’s only in Dev for now.

So I’m screwed on this one?

We all pretty much are. Just hardcode the lengths for now.