yobson1 / glua-soundduration

An alternative to the built in SoundDuration function in Garry's Mod that actually works
MIT License
14 stars 0 forks source link

Ogg support #1

Open yobson1 opened 3 years ago

yobson1 commented 3 years ago

I tried adding Ogg support but it looks like it requires 64 bit integers to be read. There is no native method for this in the file object so I tried using left bit shift and bitwise or to just read 1 byte at a time but the bit library only supports up to 32 bits as well. If there is no way to overcome this I don't think Ogg support is possible.

chev2 commented 10 months ago

Hey, just a heads up, the ability to read unsigned 64-bit integers using Gmod Lua's File handler is now possible (currently only on the dev branch of the game): https://wiki.facepunch.com/gmod/File:ReadUInt64

However, it is only for unsigned ints, not signed ints, and it is read as a string rather than a number (it might possible to just use tonumber() in Lua). Assuming these restrictions still allow for the duration to be read from OGG files, then OGG support should be possible.