SoundDuration Failing on Dedis

I’ve noticed that SoundDuration seems to return 0 on dedicated servers no matter what sound you give it.

On listenservers it returns the proper durations.

Anyone else having this problem?


19:46:00 L 12/22/2009 - 19:47:07: rcon from "My IP": command "lua_run print(SoundDuration("lasthuman.mp3"))"
19:46:00 > print(SoundDuration("lasthuman.mp3"))...
         120.52893829346

Works fine on my dedi.

I dont think it works on mounted sound files

Is the sound present on the server?

If you are using mounted things, do this:

SoundDuration("…/hl2/sounds/xxyy.mp3")



] lua_run print( SoundDuration("../hl2/sounds/buttons/button2.wav") )
0
] lua_run_cl print( SoundDuration("../hl2/sounds/buttons/button2.wav") )
0


this was on my listenserver.

Should be “sound”, without the “s” at the end.

Still prints 0.


22:23:44 > print(SoundDuration("../../hl2/sound/buttons/button2.wav"))...
         0.69687074422836


22:24:45 > print(SoundDuration("buttons/button2.wav"))...
         0.69687074422836

That’s why.

So “…/…/hl2/sound/” is the prefix to use?




] lua_run print(SoundDuration("../../hl2/sound/buttons/button2.wav"))
> print(SoundDuration("../../hl2/sound/buttons/button2.wav"))...
0.69687074422836
] lua_run_cl print(SoundDuration("../../hl2/sound/buttons/button2.wav"))
0.69687074422836


Yup.

You don’t need a prefix in the first place.

What if you wanted to access content that isn’t hl2 or content that isn’t overwritten :downs:

Offtopic: What the fuck is your avatar Rambo?

Only if the content is mounted.

ugh just stop posting cptfuzzies.